Name
The Add Album disambugation to Album title part is just the Name of the script, it could be anything but clearly makes sense to try and describe what the script does with a sensible name.
Script
The actual script is defined in the Script field, it is written in Javascript expression language,
This is similar to Filename Masks but there are two important differences:
Multiple Fields can be assigned to
Filename Mask define a script that evaluates to a single value that is automatically assigned to the filename. But for scripts multiple fields can be modified and we have to specify the field(s) to modify.
e.g script could be
artist=performer
artists=performer
so two fields will get modifed
Multiple Values can be applied
Fields such as artist or performer can have multiple values, if we want to assign multiple values to a field we can separate the values with ;;; and then when applied they will automatically be split into multiple values.
To make this easy if we are using a field that has multiple values then the result of that field will be the multiple values separted by the three semicolons, if we only want the first value then we can use fieldname_index[0] instead.
e.g
if performer contains two values Johnny Cash and June Carter and our script is
artist=performer;
the result of artist shown in the example will be
artist=Johnny Cash;;;June Carter
and this will result in
artist:
- Johnny Cash
- June Carter
If we actually wanted to assigb all the multiple values to the first value only we could do something such as
artist=performer.replaceAll(";;;",";");
and this would result in
artist:
- Johnny Cash;June Carter