Fields/tags
Ui columns will rely on your tags to work, so be sure that your files are tagged properly, otherwise you won't be able to get the best of UI columns. Common non-technical tag fields are (I give them with "%" even if I theorically should not..):
%artist%
%album artist%
%tracknumber%
%album%
%title%
Common technical fields are:
%channels%
%bitrate%
%filesize%
%samplerate%
%codec%
%length%
%__replaygain_album_gain%
%__replaygain_track_gain%
%__replaygain_album_peak%
%__replaygain_track_peak%
Accessing to a field
There are two major ways to do it:
- $meta(field): will acces to the "raw" field. $meta(artist) will give Mozart for example
- %fieldname%: will give the field but could also give related fields if the exact field is missing. (see Field remapping
Song with the following tags:
Composer=
Mozart
,
Title=
Concerto
$meta(artist) won't return anything.
%artist% will return Mozart
$meta(title) and
%title% will return Concerto
Main functions
If functions
- [%field%]: If the field exists, will return the field, should be used only in basic scripts as it may not work otherwise
- $if(cond,then,else): if cond is true, performs then, otherwise it performs else. If you don't need an else action, you can avoid it.
$if(%track artist%,%title%-%artist%,%artist%)
Displays the title and the artist only if the field track artist exists (real field or album artist and artist different) otherwise it displays the title.
- $if2(%field%,else): if %field% exists, displays the field, if, not, does else
$if2(%artist%,Missing artist)
Displays artist if it exists, otherwise displays "Missing artist"
- $if3(%field1%,[...],%fieldn%,else): Displays the first existing field, if none is found it performs else.
- $select(j,action1,[...],actionn): If j does actionj if j greater than n returns false.
$select(%tracknumber%,%artist%,%album%,%date%,%comment%)
Returns artist for the first track, then the album for the second track , then the year, then the comment.
- $ifequal(field,value,action,else) : If field is equal to value, it performs action, otherwise it does else
String comparison
- $strcmp(s1,s2) : compare s1 to s2 if equal, returns true case sensitive
- $stricmp(s1,s2) : Idem but case insensitive
Variables
- $get(name): Returns the value of name
- $put(name,value): Stores value in the variable name and returns name
- $puts( name,value): Stores value in the variable name and returns nothing
- $set_global(name,value); will set the variable as a global one (use it in the corresponding tab).
Those variables are "read only" using $sub,$mul etc.. won't work. Typically,use $puts in you code body and $set_global when the final value is set.
- $get_global(name): returns the variable name. Works only with global variables.
Related pages
July 14 2008 15:32:13.