Page 1 of 1

Inline expressions

Posted: 21 Mar 2016 13:05
by Mar
Is it true that inline expressions only work with "{blabla}" and not with '{blabla}'?

Re: Inline expressions

Posted: 22 Mar 2016 13:13
by Martin
Hi,

Yes, that's true. You can find the documentation in the help of action Script in section Inline Expressions:
[...] Inline expressions in strings with single quotes are not interpreted. This can be helpful for regular expressions, where a quantifier like {2} in the pattern ([0-9]){2}.* should not be replaced with 2.
Regards,
Martin

Re: Inline expressions

Posted: 22 Mar 2016 13:38
by Mar
Okay. The problem is that I'm using the action Plugin and I wanted to replace a configuration with a script which is located in putString with "". That's why I can only use ''.
I would like to avoid to place the action Script in front of Plugin.
But this isn't possible, isn't it?

Re: Inline expressions

Posted: 24 Mar 2016 20:52
by Martin
Could you explain the problem in more detail? I don't fully understand how you would like to modify the configuration of the plugin.

Re: Inline expressions

Posted: 26 Mar 2016 00:13
by Mar
I'm setting up a guide that tells me which episode of a series I have to watch next.
Therefore I'm using this plugin
https://play.google.com/store/apps/deta ... signplugin
It's a nice plugin which I would really appreciate to everybody. As well this one
https://play.google.com/store/apps/deta ... ceneplugin
The developer is very nice. Try them.
The code I'm trying to insert is:

Code: Select all

list=newList();
for(element in getMapKeys(getMapValue(global_widget,'Serien')))
{
folge=getMapValue(getMapValue(global_widget,'Serien'),element);
string='Staffel {getElement(folge,0)} Folge {getElement(folge,1)}';
addElement(list,string);
}
s='{list,listformat,comma}'
I'll ask another thing regarding these plugins later on.

Code: Select all

putString("com.yourcompany.yourapp.extra.STRING_ITEMS", "{list=newList();
for(element in getMapKeys(getMapValue(global_widget,'Serien')))
{
folge=getMapValue(getMapValue(global_widget,'Serien'),element);
string='Staffel {getElement(folge,0)} Folge {getElement(folge,1)}';
addElement(list,string);
}
s='{list,listformat,comma}'}");
Thanks a lot.

Re: Inline expressions

Posted: 26 Mar 2016 19:30
by Martin
Would it be possible to build the comma separated list first and then pass it to the plugin?

Something like this:

Code: Select all

list=newList();
for(element in getMapKeys(getMapValue(global_widget,'Serien')))
{
   folge=getMapValue(getMapValue(global_widget,'Serien'),element);
   string="Staffel {getElement(folge,0)} Folge {getElement(folge,1)}";
   addElement(list,string);
}
s="{list,listformat,comma}";

putString("com.yourcompany.yourapp.extra.STRING_ITEMS", s);

Re: Inline expressions

Posted: 04 Apr 2016 23:45
by Mar
Okay. After an technical bug caused by the plugin it's working well. I have placed the script inside the plugin action in front of putString()
Thanks