Cuetools templates
From CUETools wiki
CUETools output path templates are based on foobar2000 title formatting syntax.
Contents |
Variables
- %music% is replaced by current user's 'My Music' folder.
- %artist% is replaced by the artist name
- %album% is replaced by the album name
- %year% is replaced by the album date
- %discnumber% is replaced by the disc number in a multidisc release
- %totaldiscs% is replaced by the total number of discs in a multidisc release
- %unique% is replaced by the number starting from 1, and increased until the output path is unique.
- All other variable names, e.g. %edition%, are considered tag names, and are replaced by value of the corresponding tag
Conditional section
- Text encolosed in brackets is removed if variables inside it are undefined. For example, "[%year% - ]%album%" evaluates to "1973 - Dark Side Of The Moon" if the date is specified in CUE Sheet or tags, else it evaluates to "Dark Side Of The Moon".
Functions
- $len(a) calculates the length of given text (in characters)
- $max(x,y) calculates the maximum of two numbers
- $ifgreater(x,y,a,b) evaluates to "a" if x > y, else it evaluates to "b".
- $iflonger(a,b,c,d)
- $ifequal(a,b,c,d)
- $if(a,b,c)
- $if2(a,b)
- $if3(a,b,...)
Quotation Mark
- Text enclosed in single quotation marks, e.g. '(%)' is inserted bypassing syntax processing; allows special characters such as %,$,[,] to be inserted. In order to insert a quotation mark character, use '' (two single quotation marks).
Examples
%music%\Converted\%artist%\[%year% - ]%album%[ - %edition%]
$ifgreater($max(%discnumber%,%totaldiscs%),1, - cd %discnumber%,)
[' ('%unique%')']\%artist% - %album%[ - %edition%].cue
This default template can produce the following:
C:\Users\johndoe\My Music\Converted\Pink Floyd\1973 - The Dark Side Of The Moon\Pink Floyd - The Dark Side Of The Moon.cue
If such file already exists, than %unique% variable will be set to 1 and the following output be produced:
C:\Users\johndoe\My Music\Converted\Pink Floyd\1973 - The Dark Side Of The Moon (1)\Pink Floyd - The Dark Side Of The Moon.cue
If edition tag is set e.g. to CP35-3017, this will produce
C:\Users\johndoe\My Music\Converted\Pink Floyd\1973 - The Dark Side Of The Moon - CP35-3017\Pink Floyd - The Dark Side Of The Moon - CP35-3017.cue
If %discnumber% or %totaldiscs% is greater than 1, " - cd %discnumber%" section will be activated:
C:\Users\johndoe\My Music\Converted\Pink Floyd\1969 - Ummagumma - cd 1\Pink Floyd - Ummagumma.cue