Up-to-date with version 3.0.5994
Templates are generic formulas constructed from tag fields (where each tag field is surrounded by <>, e.g. <Artist>), Functions, and plain characters. When the template is applied to an individual track, the tag fields are filled with that track's tags, the functions are processed, and MusicBee outputs the result.
MusicBee uses templates to:
- Create directories and filenames for organized and synced files
- Display Virtual Tags, Track Information, and Player text
- Send info to the clipboard that other programs can use
- Provide parameters for External Tools and Web Links
- Extract tag data from filenames
Creating a Template Edit
Anywhere in MusicBee that you can enter a template, you can open the Template Editor by clicking the [...] button at the end of the field. The Template Editor gives you a bigger space for seeing a long template. At the right end is a Field Selector which can help you insert fields into your template, and a Function Selector to insert functions.
The Validate button will check your template for errors. If there are no errors, it will report "OK" at the bottom of the window. If it finds an error, it will attempt to tell you where the problem is, but this is not always easy to interpret (especially if there are many nested functions). If you're having trouble tracking down an error, looking at your template in a text editor with syntax highlighting may help (Notepad++ is a popular one).
For templates containing Custom Tags or Virtual Tags, if you change the name of the tag, the template will be updated automatically. However, if you move a custom or virtual tag to a different slot (for instance, if you move the Sort Artist tag from the Custom 1 slot to the Custom 3 slot) and you still want to use that tag, you will need to update the template.
Template Tips Edit
- Folder Hierarchy
- Templates for file organization can include a folder hierarchy using the backslash (\) character as the folder separator. In other templates, the backslash will be rendered as plain text.
- Unknown <Tag>
- To keep MusicBee from outputting "Unknown" when a field is blank, you can use the $IsNull function:
- Web Links
- In web links, the ampersand (&) and certain other characters will break the URL. To avoid this, use the $Replace function to substitute their URL equivalents: