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 ?
Patterns, new scripts
Re: Patterns, new scripts
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
Code: Select all
%# | | %
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
Code: Select all
%#D|2|# - #%
Code: Select all
gTag.ParseValue
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
Code: Select all
%@#filter_track_album.scv% = 1
-
- Sr. Member
- Posts: 294
- Joined: Wed Sep 15, 2010 1:38 pm
Re: Patterns, new scripts
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?
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
This is missing the pattern parameter
This is the correct value:
'#' represents the tokens and '-' is the separator
Another example would be:
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.
Code: Select all
%#D|2| - %
Code: Select all
%#D|2|# - #%
Another example would be:
Code: Select all
File name: 01.Eagles - Hotel California
%#F|1|#.#-#% -> 01
%#F|2|#.#-#% -> Eagles
%#F|3|#.#-#% -> Hotel California
Code: Select all
%@scriptfilename%
-
- Sr. Member
- Posts: 294
- Joined: Wed Sep 15, 2010 1:38 pm
Re: Patterns, new scripts
I would put both example and explanation in the help !jtclipper wrote:'#' represents the tokens and '-' is the separatorCode: Select all
%#D|2|# - #%
Code: Select all
File name: 01.Eagles - Hotel California %#F|1|#.#-#% -> 01 %#F|2|#.#-#% -> Eagles %#F|3|#.#-#% -> Hotel California
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 % ?
Great, thank you.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.Code: Select all
%@scriptfilename%
Re: Patterns, new scripts
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.
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.
-
- Sr. Member
- Posts: 294
- Joined: Wed Sep 15, 2010 1:38 pm
Re: Patterns, new scripts
Thank you !