Page 1 of 1
Patterns, new scripts
Posted: Wed Feb 12, 2014 6:03 pm
by hopalongrock
In the example from the help text
" %#U1|2|# - #% returns the second token of the U1 variable if applicable "
the text between the second and third # , namely " - " (without the quotes) is the token separator ?
Is %#D|2|# - #% equivalent with %D2% using " - " separator ?
I see the pattern usage in #filter_track_album.scv, although gTag.ParseValue( '%#A|2|#-#%', false, false, false ) isn't explained in the help.
..........
What is the purpose and the usage of the .scv scripts ?
For example how can I use a script like #filter_track_album.scv ?
Re: Patterns, new scripts
Posted: Wed Feb 12, 2014 7:40 pm
by jtclipper
Pattern variables use a specific syntax
The | is needed to separate the variable into 3 groups
The first group is the %variable% name and it's value will be parsed against the mask defined in group 3, group 2 is the token number
will yield the %D% variable's 2nd token for this specific mask '# - #' mask characters in those variables use the # character
is a new function, the help file will be updated with the new functions. it's purpose is to expand variables to real values
The new .scv scripts are code snippets that contain arbitrary logic and set a return value, they can be used anywhere normal %..% variables are used
For example in the filter you can select
this variable will return '1' when a specific condition are met, and will behave like a simple variable otherwise
Re: Patterns, new scripts
Posted: Wed Feb 12, 2014 9:51 pm
by hopalongrock
Sorry, although I read the syntax is %# | | % , the example misguided me, and I thought, that the 2nd and 3rd # is the part of syntax.
Only to see, that I understand well: Is %#D|2| - % equivalent with %D2% using " - " separator?
Is the "@" character part of the syntax in %@#filter_track_album.scv% = 1 or only a typo?
Re: Patterns, new scripts
Posted: Wed Feb 12, 2014 10:33 pm
by jtclipper
This is missing the pattern parameter
This is the correct value:
'#' represents the tokens and '-' is the separator
Another example would be:
Code: Select all
File name: 01.Eagles - Hotel California
%#F|1|#.#-#% -> 01
%#F|2|#.#-#% -> Eagles
%#F|3|#.#-#% -> Hotel California
The syntax is
%@#filter_track_album.scv% is correct the '@' is needed to declare the variable as a script one, those will also appear in the pop menu under the user sub-menu.
Re: Patterns, new scripts
Posted: Thu Feb 13, 2014 6:07 am
by hopalongrock
jtclipper wrote: '#' represents the tokens and '-' is the separator
Code: Select all
File name: 01.Eagles - Hotel California
%#F|1|#.#-#% -> 01
%#F|2|#.#-#% -> Eagles
%#F|3|#.#-#% -> Hotel California
I would put both example and explanation in the help !
Am I right, that this is equivalent to the mask used in the options/use mask, only # appears instead of % ? In this case maybe we could use # in options/use mask too , instead of % ?
jtclipper wrote:The syntax is
%@#filter_track_album.scv% is correct the '@' is needed to declare the variable as a script one, those will also appear in the pop menu under the user sub-menu.
Great, thank you.
Re: Patterns, new scripts
Posted: Thu Feb 13, 2014 12:27 pm
by jtclipper
The Help file will receive a few updates and these examples are nice to have so I'll put them there.
I thought about using # instead of % in the masks also and will probably go ahead and do it taking care of the older option automatically.
Re: Patterns, new scripts
Posted: Thu Feb 13, 2014 2:07 pm
by hopalongrock
Thank you !