This part comes for a big part from the unofficial guide of picmixer
For some standard of the non common tags, go there.
Foobar uses TAGZ langage. For the description of the main functions, view the titleformat_help.html in your foobar folder. Masstagger is useful to introduce tags that you consider as important but are not common to everybody(especially for classical music listeners).
To write properly any script you must make it clean, with breaklines and Co. or you will be lost to know where your code is not correct and you won't be able to ask anyone to help you as it will be messy and not understandable (even by the software itself!!). You have to take some good customs before it is too late.
the basis:
the usual way to use a tag is by %tag% for example: %artist%, %title%, %tracknumber% but could be %_codec%,%_lenght% etc... But don't boggle the Tag name and its value. artist is the name of the tag. Limp Bizkit, Bob Dylan some values of the tag artist. As a consequence %Bob Dylan% or %Limp bizkit% is not correct.
For the examples, It will be:
the original soundtrack of the movie cruel intentions:
and the album Homework of the daft Punk:![]()
Example:
- $abbr(%tag%): Creates abbreviation of %tag% (uses the first character of each word).
Example:
- $abbr(%title%) will return EYEM for Every You Every Me
- $abbr(%tag%,N):Creates abbreviation of %tag% if %tag% is longer than N characters; otherwise inserts full value of %tag%.
Example:
- $abbr(%title%,15) will return EYEM but Coffee & TV
- $add(N1,N2,...): Adds multiple integral numbers (N1+N2+...). Accepts any amount of parameters.
Example:
- $add(%tracknumber%,1) will increase each tracknumber by one
- $and(x,y...): Performs logical AND operation on parameters (in other words:Checks if all of the argument are here.). For use with $if()-type functions and other logical operators.
Example:
- $if($and(%tracknumber%,%title%,%various%),%tracknumber%-%title%-%artist%,%title%) will return 01-Every you Every Me-Placebo but Daftendirekt because the various field is not present for the album made by daftpunk
- $if($and(%year%,%genre%),%year%,%genre%) will return soundtrack and club because if the value %genre% exists, the value %year% doesn't exist
- $ansi(%tag%) Converts %tag% to system codepage and back. Any characters that aren't present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.
- $caps(%tag%) Converts first letter in every word of %tag% to uppercase, and all other letters to lowercase.
Example:
- $caps(%title%) will transform WDPK 83.7 FM into Wdpk 83.7 Fm or EVERY YOU EVERY ME into Every You Every Me
- $caps2(%tag%) Similar to $caps, but leaves uppercase letters as they are. Example:
- $caps2(%title%) will transform WDPK 83.7 FM into WDPK 83.7 FM but Praise You (radio edit) into Praise You (Radio Edit)
- $char(NNN) Inserts Unicode character no. NNN. for a description of the unicode characters go to their website
- $crlf(): Inserts end-of-line (carrier return / linefeed) code. Useful for multiline scripts.
- $cut(%tag%,N): truncates the %tag% value to its N first characters.
Examples:
- $cut(%album%,4) will give you Home
- $cut(%title%,11) will give you Every you E
- $directory(%tag%), $directory(%tag%,N): Extracts directory name from file path %tag%, optionally goes up by N directory levels.
Example:
![]()
- $directory(%_path%) (which is the same as $directory(%_path%,1)) will return sexe intentions (BO)
- $directory(%_path%,2) will return MP3 Boris (Boris isn't my name, just one of my friends'..)
- $div(N1,N2): Divides integral number N1 by integral number N2.
Example:
- $div(%tracknumber%,100) will divide by 100 the tracknumber value and truncates it into an integer value (0 if original number is 01, 1 if original number is 150)
- $ext(%tag%) Extracts extension from file path / file name.
Example:
- $ext(%_path%) will return mp3
- $filename(x) Extracts file name from full path.
Example:
- $filename(%_path%) will return 01. Every You Every Me
- $fix_eol(%tag%) Scans %tag% for end-of-line marker (CR/LF), if found - truncates and appends " (...)".
- $fix_eol(%tag%,action1) Scans %tag% for end-of-line marker (CR/LF), if found - truncates and appends action1.
- $greater(N1,N2) Compares two integral numbers, tests if N1>N2. For use with $if()-type functions and other logical operators.
Example:
- $if($greater(%TRACKNUMBER%,100),$div(%TRACKNUMBER%,100),%DISC%) will divide by 100 the tracknumber if gretaer than 100, else will return %DISC%
- $hex(N) Converts integral number N from decimal to hexdecimal notation.
Example:
- $hex(%_playlist_number%) to have your playlist number in hexdecimal
- $hex(N1,N2) Converts integral number N1 from decimal to hexdecimal notation, pads with zeros to N2 digits.
Example:
- $hex(%_playlist_number%,3) to have your playlist number in hexdecimal and with a length of three
- $if(%tag%,action1,action2): if the %tag% is existing is completed returns the action1, else does the action2
Example:
- $if(%tracknumber%,%tracknumber% - %title%, %title%) if the tracknumber field exists, will return 01 - Every You Every Me else, will return Every You Every Me
- $if(%various%,%tracknumber% - %title% - %artist%,%tracknumber% - %title%) will return 01 - Every You EverY Me - Placebo, but 01 - Daftendirekt
- $if2(%tag%,%tag%) Same as $if(%tag%,%tag%,b).
Example:
- $if2(%tracknumber%,%title%) if the tracknumber field exists, will return 01 else, will return Every You Every Me
- $if2(%various%,%tracknumber% - %title%) will return 1 (the value is set to 1 for various that's why it returns 1), but 01 - Daftendirekt
- $if3(%tag&%,%tagé%,%tag3%,..) Returns first of items being true/non-empty.
Example:
- $if3(%year%,%%genre%) will return
- $if3(%artist%,%year%) will return Placebo, Daft Punk
- $if3(%genre%,%artist%) will return soundtrack, club
- $num(%tag%,N): will return the numerical value and complete it to N characters with zero
Example:
- $num(%tracknumber%,2) will give you 03 for the value 3 and 13 for 13.
- $left(%tag%,N) will return the N first characters by the left of the tag value
Examples:
- $left(%album%,4) will give you Home
- $left(%title%,15) will give you Every you Every
- $num($left(%_filename%,2),2) will give you 03 if the file is named 03 - Daft Punk - Daftendirekt.mp3
- $right(%tag%,N) will return the N first characters by the right of the tag value
Examples:
- $right(%album%,4) will give you work
- $right(%title%,12) will give you you Every Me
- $num($right(%_filename%,2),2) will give you kt if the file is named 03 - Daft Punk - Daftendirekt.mp3
- $strchr(%tag%,Y): Finds first occurrence of character Y in string %tag%.
Example:
- $cut(%title%,$strchr(%title%,y)) will return Every
- $strrchr(%tag%,Y): Finds last occurrence of character Y in string %tag%.
Example:
- $cut(%title%,$strrchr(%title%,y)) will return Every You Every
- $sub(X,Y) Subtracts integral number Y from integral number X
Example:
- $sub(%tracknumber%,1) will decrease by one each tracknumber
- $ifgreater(N1,N2,action1,action2) If number N1 is greater than number N2, return/execute action1, otherwise return/execute action1.
Example:
- $ifgreater(%tracknumber%,1,%title%,$upper(%title%)) will return EVERY ME EVERY YOU but Praise you (radio edit)
- $ifgreater(%tracknumber%,100,$sub(%tracknumber%,100),%tracknumber%) will return 60 for a tracknumber which is 160
- %tag%: returns the value of the corresponding tag. you can put several tags in the same chain (see example 3)
Examples:
- %artist% will give you Daft Punk
- %album% will give you Soundtrack cruel intentions
- %album% - %genre% will give you Homework - Club