Scripting Functions
The following is a list of the Picard scripting functions grouped by function type.
Warning
A common error when using scripting functions is to add a space after the comma separating the arguments, or enclosing a value in quotes. Picard will consider both of these as part of the argument, which will cause the function to not work as expected. For example, if you have a script that checks if the artist is “My Artist”, but the check is $eq(%artist%, My Artist) or $eq(%artist%,"My Artist"), the match will not work. The correct syntax should be $eq(%artist%,My Artist) without the extra space or quotes. This is a common occurence when using AI to develop scripts, because it often introduces extra spaces such as a space after the comma separating arguments or quotes around the value.
Assignment Functions
These functions are used to assign (or unassign) a value to a tag or variable. The assignment scripting functions are:
Text Functions
These functions are used to manage text (e.g.: extract, replace or format) in tags or variables. The text scripting functions are:
Multi-Value Functions
These functions are used to manage multi-value tags or variables. The multi-value scripting functions are:
Mathematical Functions
These functions are used to perform arithmetic operations on tags or variables. The mathematical scripting functions are:
Conditional Functions
These functions are used to test for various conditions and take appropriate actions depending on the results of the test.
Warning
Formatting the code in your scripts by adding things like spaces, tabs and newlines could affect the results of conditional tests because these characters are not ignored. For example,
$set(test,)
$if(
%test%,
$set(test1,Not Empty),
$set(test1,Empty)
)
$if(%test%,$set(test2,Not Empty),$set(test2,Empty))
will return “Not Empty” for %test1%, but “Empty” for %test2%. The different values are a result of the indentation in the formatted code.
The conditional scripting functions are:
Information Functions
These functions provide additional system or data information. The information scripting functions are:
Loop Functions
These functions provide the ability to repeat actions based on the contents of a multi-value variable or the result of a conditional test. The loop scripting functions are:
Miscellaneous Functions
The miscellaneous scripting functions are: