Renaming and Restructuring Files and Folders (v9.0)

Download as PDF

Back to Yate Resources

The two most common questions we get are "Can Yate rename my files to..." and "Can Yate restructure my folders as...". The answer to both questions is yes.

Before we start, this is an opportune time to mention that all rename templates presented in this document are available for importing in Yate. In Settings - Rename Settings, use the install sample rename templates button and import the Renaming and Restructuring Files and Folders actions, The version number of the actions will be the same as the version number of this document. The actions are used to import the referenced rename templates. Each rename template is named Renaming and Restructuring - reference number. The templates are marked as hidden. It is recommended that you duplicate any template that you want to modify.

Note that any code snippets used in this document are also included as separate actions. These actions are imported at the same time as the templates. The action names are Renaming and Restructuring Files and Folders - Snippet #, where # is the same as the presented rename template.



Table of Contents

Apple Apps and Renaming

What's the Difference Between Renaming and Moving?

Templates and the Token Editor

Post Rename Functions

What Characters Fall into the Almost Category

Extraneous Spaces

Advanced Post Processing Settings

Simple Renaming

Conditional Insertion

Restricting the Length of a Name

Duplicate Handling

Multiple Values

Conditional Tests

Renaming Folders

Sorting Considerations

Special Field Handling

There are no Tokens for What I Need!

Testing Expressions

Moving or Copying Files to a New Folder Structure

Quick One Off Renaming

Summary

Document History



Apple Apps and Renaming

Unless you configure Music, TV and iTunes correctly, they will mess up anything you want to achieve by renaming your files.

In Music-Settings-Files, TV-Settings-Files and iTunes-Preferences-Advanced you will find two settings which must be unchecked. The settings with slight variations will be called:

Keep Music/TV/iTunes Media folder organized
Copy files to Music/TV/iTunes Media folder when adding to library

The first setting will allow the Apple app to rename your files as it sees fit. The second will copy the files to its own notion of a folder structure,

If you are going to rename or move your files around, make sure that the tracks are linked to iTunes/Music/TV when you do the changes. This is necessary so that the application's library gets correctly updated. Note: if your tracks have retained Apple App PIDs (recommended) you can always refresh files when next linked to update to a new location.



Back to Table of Contents




What's the Difference Between Renaming and Moving?

At the system level there is not much that is different ... everything is a Move. The differences appear due to the semantics applied when the functions are executed. One big difference is that volume changes cannot occur when renaming. Moves can be from any source to any destination. The biggest difference to get your head around is that moves create non existant path components while renames change the name of existing path components.

If no folder names are modified, added or removed the two functions are essentially identical. When the number of folder components is changed or the actual location of a file is being changed, a Move must be used.

At times it is advantageous to move files as opposed to renaming them. Renaming always preserves the original folder structure and simply changes names. Regardless as to how many files are in a renamed folder, they always remain together. Moves, however, can put different files in different folders, creating the folders if required. Renaming only makes sense when all files in a folder have the same metadata used to name folders.

When files are moved, a single file is moved at a time. This is done in complete isolation to any other loaded file. After a file is moved it is entirely possible that the new and old folders exist. Even if you move all the audio files in a folder to another, non audio files will not automatically follow. (Yate does have an action statement to handle this situation named Move Non Audio Files). Other than automatically creating path components when necessary, you are really only working with a file.

When files are renamed you are working with individual path components. Yate renames (actually moves) each modified folder path component and file individually. All loaded files, whether being renamed or not must be adjusted for renamed folder path components. Here's an example. You have ten files loaded which are in .../Music/Folder1/Folder2. You select one file and rename its filename and at the same time rename Folder2 to be the Album field and Folder1 to be the Artist metadata. While the order of operations may vary this is essentially what happens:

Because Yate is renaming the folder path components, the issue of files not being moved does not exist. However, if audio files in Folder2 have different Artist or Album metadata, Folder1 and Folder2 may be renamed multiple times. When done, the original files will always be in the same folder.

The choice of renaming or moving files is one of function. Basically remember that when moving a file only the file is being moved. When renaming a file, the file may be renamed as well as individual path components.

Yate has a Create Move Action Wizard which can generate an action to move files based on a rename template. The generated actions are automatically placed on the various Rename>Actions menus so that it can be accessed from the UI as easy as any rename template. These move actions are created by selecting a single rename template in Settings - Rename - Templates and then hitting the blue action button. The Create Move Action Wizard is the recommended method of generating actions to move or relocate your files. It can handle virtually all scenarios that we're asked about. While you can still roll your own actions using the Move action statement, it is advised that you use the wizard for all typical move scenarios. The actions generated by the wizard have lots of embedded sanity checks to ensure that your files end up relocated as you intended. Futher, the generated actions can be called by other actions that your write and can be designed to be run in immediate mode or via the Batch Processor.



Back to Table of Contents




Templates and the Token Editor

Yate uses rename templates to define what happens when files get renamed. These templates can be accessed directly from the UI; from within actions and by the Create Move Action wizard. The templates are defined in the Rename section of the application preferences. Many of the standard metadata fields can be directly applied in the templates and are sufficient for most renaming needs via the UI. When highly conditional or specific extracted data is required, it may be necessary to write an action to do the renaming. Rename templates can access Track Variables.

The rename templates are created in Yate's token editor. The use is quite simple. You add text and tokens wherever you see fit. You have absolutely no control over the filename extension and do not have to worry about it. In the token editor, tab characters and newline characters are ignored and can be used for formatting to make the template easier to read. Space characters are relevant and are displayed as centered dots so that they are easier to identify.

Tokens are added from the text field's context menu. An abbreviated list of tokens can be displayed by holding down the Control key and typing the first letter of the token you're looking for. Note that on certain versions of the OS and depending on other applications that may be installed, some letters will not work. If this is the case hold down the Control and Shift keys when typing the letter.



Back to Table of Contents




Post Rename Functions

Most people do the majority of their text manipulation prior to renaming. However, every rename template allows you to specify that certain functions should be applied after the new name is constructed.

If you want to perform alphabetic case manipulation, the process can be controlled by the Case, Field Exception, Name exceptions, General exceptions, Replacement and Roman # options. We're not going to look at the case transformations in this document. There is a Yate help topic called Alphabetic Case Transformations which describes the options in detail.

The Spaces to _ setting will do as the name implies, changing all space characters in the constructed filename to underscore characters.

Macs support just about every possible character in filenames (almost). Yate always modifies colon (:) and forward slash (/) characters. What gets substituted is specified in the Settings - Rename - Settings Invalid Character substitution field.

There are cases where you might want to have the characters fall entirely in the ISO Latin-1 character set. One possible reason is that you want to place your tracks into m3u files and your player does not support the m3u8 variants. The Force Latin-1 option will ensure that only Latin-1 characters are in the constructed name. It does this by finding somewhat equivalent characters and by dropping characters if required. You can alternately Force ASCII which reduces the number of available characters to an even smaller set. If you wish you can simply Remove Accents from characters.

All three of the above encoding changes also fold Unicode character equivalents. By default, this normalizes all dash, single quotes and double quotes variants to be their ASCII equivalents. The characters to be folded can be extended. See the Fold Characters Substitutions for specific information. If you wish you can only do the folding by specifying an encoding of Fold Unicode.

The File Extension settings are used to tell the Finder how to display the filename extensions. You can choose to leave the display option unchanged or you can force the display or hiding of extensions.

Note that in Settings - Rename - Settings you can force lowercase filename extensions whenever a file is renamed.



Back to Table of Contents




What Characters Fall into the Almost Category

Currently Yate always replaces : and / characters when renaming files. The text that replaces the characters is specified in the Settings - Rename - Settings - Invalid character substitution setting. While you can create filenames in the Finder with embedded / characters, it is not a good idea. The APIs that Yate has to use do not differentiate between an embedded / and a / which is a path delimiter. Further certain APIs return /s as :s and it is not consistent across all APIs.

Yate also always removed leading periods from path components and filenames. A leading period is used to denote a hidden file on Macs.



Back to Table of Contents




Extraneous Spaces

You can also configure how Yate handles extraneous spaces when renaming. The Settings - Rename - Settings - Space handling setting allows you to control how spaces are modified in each manipulated path component when renaming, copying or moving files. The choices are as follows:

No Changes
Spaces are not modified.

Remove Leading/Trailing
Leading and trailing spaces are removed.

Remove Leading/Trailing and Compress
Leading and trailing spaces are removed and sequences of multiple spaces are replaced with a single space. This is Yate's initial setting.


Back to Table of Contents




Advanced Post Processing Settings

The rename token editor has a ⚙️ button at the top right of the panel. When you click the button, an advanced settings panel is displayed. Note that the circle icon to the left of the ⚙️ button is grey when no advanced settings are enabled and green when at least on advanced setting is enabled.

The advanced settings allow overrides and additional granularity for global rename settings.

While it is possible to have a replacement set which removes characters invalid in Windows, the advanced setting panel has a setting which enables the substitution of \ * ? " < > | characters with an underscore (_).

You have complete granularity of removing leading spaces and underscores; trailing spaces, underscores and periods; compressing sequences of spaces and underscores. When compressing, spaces and underscores can be handled separately or combined. The sequences can be replaced by a space, an underscore or the first character in the sequence being replaced.

The advanced settings optionally enables special processing when inserting text for duplicate filenames and when processing an Alpha token. These are discussed later.

Note that if any of the advanced rename settings are enabled, the default handling of spaces in filenames as defined in Settings - Rename - Settings - Space handling is disabled.



Back to Table of Contents




Simple Renaming

Let's say you want to rename your files to start with the track number padded to two digits followed by a space and the tracks's title. Simply enter the appropriate tokens and text as follows:

――――  Renaming and Restructuring 1


ren1

That's it! Notice the centered dot between the two tokens. That's the space character.



Back to Table of Contents




Conditional Insertion

Assume you want the template above to be modified to insert the disc number padded to two spaces but only if it exists. In this case exists means not empty or zero. If it does exist we want the disc number followed by a dash.

――――  Renaming and Restructuring 2


ren2

The IfExists field token implies that the following text and tokens should only be applied up to the next Else or endIf token, if the field exists. If the field does not exist and an else token is supplied, all text and tokens after the Else until the matching endIf will be processed. In the above example if Disc exists, we're inserting the Disc token and a dash character.

As a convenience, there is a special form of the IfExists token which implies if the specified field exists, insert it immediately after the token. The previous template can be simplified to:

――――  Renaming and Restructuring 3


ren3

Tokens which begin with the following names treat a numeric value of 0 as being equivalent to empty: Disc, Episode, Movement Number, Season and Track. Any custom field defined as being a Yes/No value will also treat a numeric value of 0 as equivalent to being empty.

As a somewhat silly example, let's say we want to specify ND if there is no disc number.

――――  Renaming and Restructuring 4


ren4

Back to Table of Contents




Restricting the Length of a Name

If you wanted to limit the length of a name to 100 characters, you could do the following:

――――  Renaming and Restructuring 5


ren5

The above template inserts the Title field and then tests if the result is longer than 100 characters. If it is, the name is truncated to 99 characters and a horizontal ellipsis (...) is inserted. The ❨Break❩ token does not insert anything. It serves as a token which can be used as a terminator of a text field or to separate two text fields. In the above example the IfLength and Truncate tokens read the following text field for the number. If for any reason, number is followed by text a ❨Break❩ token must be used.

There is also a Settings - Rename - Settings - Automatically truncate path components setting. It can be difficult to determine if a filename or path component is too long for an underlying filesystem. The setting attempts to remove some of the burden. When set, filenames and path components will be reduced to fit within 255 bytes based on the system's representation. Note that due to encodings, a truncated component may be less than 255 characters. Bytes were chosen as a unit, as APFS is based on UTF8 characters, HFS+ is based on UTF16 characters, etc. The setting errs on the side of caution. It is possible that extra characters can be manually entered when editing a path component in the Finder.


Back to Table of Contents




Duplicate Handling

It is entirely possible that when you rename files you will end up with a duplicate filename. For example, if you're renaming files to the Title field, and more than one track is named Intro. Yate allows you to handle duplicate filenames in the template. You can insert whatever text and/or tokens you wish inside of the duplicate sequence. However, it is typically better to let Yate pick a single number to differentiate the copies.

――――  Renaming and Restructuring 6


ren6

The above template sets the name to consist entirely of the Title field. If it is a duplicate, it adds a space and the first available duplicate number.

Duplicate processing, can cause issues with removing trailing spaces and underscores as a duplicate sequence can be added at the end of the path component or filename. The template advanced setting Apply transformations for IfDup, applies various transformations before the insertion point of a duplicate sequence. more information can be found on the help for the advanced rename settings panel.

It is strongly recommended that all rename templates which have a filename component, specify an IfDup, Dup # sequence. This is especially true when using a rename template when moving files. The duplicate handling enables the Keep Both option when a file already exists. In practical usage, all the preceding examples should have had duplicate handling tokens.


Back to Table of Contents




Multiple Values in Fields

There are two methods of handling multiple values in fields. If the Settings - Rename Multi Value Delimiter substitution setting is empty, all values following a multi value delimiter (typically ;;;) are ignored. If the setting is not empty, multi value delimiters are replaced with the specified text. As an example, if you specify " and " as the rename substitution, all ;;; sequences will be replaced with " and ".

You can also use a ❨Multi Value Delimiter❩ token to override the rename substitution setting in a template. These tokens can be specified as many times as desired in a template to provide complete granularity on how multi value delimiters are processed. If the token is followed by text, the text becomes the replace substitution value. If the token is followed by another token, the replace substitution value is set to empty. The following example overrides the default value only for the Album Artist field.

――――  Renaming and Restructuring 7


ren7

The above template renames each file to Title followed by [Genre] where multiple items in Genre use and as the delimiter. Note that the Break token is used to force a no text situation before the "[" text which is being inserted before the genre.

You can also test if a field contains multiple values. One possible use of this is that you possibly only want to include a field if it does. The IfMultiple field token is another if-then-else token which tests if the specified field has multiple values. The following example only includes the Artist field in a filename if it contains multiple values. A comma is used to separate the multiple values.

――――  Renaming and Restructuring 8


ren8

Back to Table of Contents




Conditional Tests

We've already covered a few If tokens. All If tokens test a condition. If the condition is true, all tokens and text up to the next Else token, if present, or matching endif token if Else is not present, all processed. If the condition is false and there is an Else token, all tokens and text which follow the Else token until the matching endif token are processed.

We say matched endif token as if - Else - endif sequences can be nested.

We've already covered the IfDup, IfExists, IfExists+, IfLength and IfMultiple tokens. The following is a brief explanation of the remaining If tokens.

The IfArtistEqualsAlbumArtist token can be used to construct a sequence depending on whether the Artist field is equal to the Album Artist field. As an example assume that you want a filename to be the Title followed by the Album Artist. If Artist differs from Album Artist you want it to be included in the name.

――――  Renaming and Restructuring 9


ren9

The IfCompilation token can be used to determine if a track has Part of a Compilation set. As an example, let's append -[Compilation] to the filename, if appropriate.

――――  Renaming and Restructuring 10


ren10

The IfTrue and IfFalse tokens can be used to test if a condition is true or false. The condition can be one of the following: a property test such as hasVideo, a test if a file is a particular audio type, a test if a track variable is true or false. A track variable containing true (case insensitive) is not false. Any other text which has an integer value of 0 is treated as false. Remember that Yate determines an integer value by accumulating leading decimal digits. As an example assume that a filename of Title has the Classification field appended if the track contains video and Classification is not empty.

――――  Renaming and Restructuring 11


ren11

The IfMultiDisc token is used to determine if a track is part of a multi disc album. The condition is true if at least one of the Disc or Disc Count fields have a value greater than 1. In the following example a filename is preceded by the disc number.

――――  Renaming and Restructuring 12


ren12

The IfVariousArtists token is used to test if the file's Album Artist field contains Various Artists (case insensitive). If the Album Artist field contains multiple items separated by the multi value delimiter, true will be returned as long as one of the items is Various Artists. As an example let's expand on the IfCompilation example to treat any album with an Album Artist field of Various Artists as a compilation.

――――  Renaming and Restructuring 13


ren13

All If tokens test various metadata or properties of individual files. At times, it can be advantageous to have direct control over the flow of the template. The user state is a boolean value which is initially false when template processing starts. The UserStateIsFalse and UserStateIsTrue tokens can be used to modify the value of the user state. The IfUserState token tests if the user state is true. The following example modifies the IfVariousArtists example.

――――  Renaming and Restructuring 14


ren14

Back to Table of Contents




Renaming Folders

In much the same way that you rename files, you can rename folders. You rename files and/or folders in a single template. The folder renaming portion of a template follows the filename portion of the template. The Folder Start token stops all filename processing and begins folder renaming. Any open if tokens are automatically closed. As an example, the following template renames the containing folder to be the Album name and the filename to be the Title.

――――  Renaming and Restructuring 15


ren15

The following example renames the folder to the year component of the Year field followed by the Album field:

――――  Renaming and Restructuring 16


ren16

You can rename more than one path component by specifying multiple Folder Start tokens. All renaming is done right to left in a path. The start of a template defines the structure of a filename. The text and tokens after the first Folder Start token specifies the name of the folder containing the file. The second Folder Start token renames the folder containing the folder which contains the files. etc.

You must define something after a Folder Start token otherwise at runtime you will get an empty path component error. If you do not wish to modify a path component which is followed by subsequent Folder Start tokens, specify an Initial Folder or Current Folder token. Here's a simple example which renames files to the commonly used .../Artist/AlbumTitle format:

――――  Renaming and Restructuring 17


ren17

If there are more Folder Start sequences specified than there are available path components, they are silently ignored at runtime.

If you know that a path component is optional and can end up being empty, you can specify an Ignore if Empty token in the Folder Start section. When Ignore if Empty is present and a path component ends up being empty, the Folder Start section is ignored.


Back to Table of Contents




Sorting Considerations

All of the sort fields contained in Yate are available as tokens. If you are not maintaining the sort fields there may still be times when you want to remove leading articles from a field. The Remove Leading Articles token causes a single leading article, if present, to be removed from all subsequent inserted fields. The list of articles which are to be removed is defined in the Settings - Exception Natural Sort Set. To stop removing articles, you can specify a Preserve Leading Articles token. For example the following template renames the containing folder to Artist - Album removing a leading article from the artist metadata:

――――  Renaming and Restructuring 18


ren18

Back to Table of Contents




Special Field Handling

The Album Artist token will insert the Artist field if the Album Artist field is empty.

The Year token respects the Format the Year field setting as defined in Settings - File List. The Year4 token always inserts the year as YYYY.


Back to Table of Contents




There are no Tokens for What I Need!

It is entirely possible that the filename you want to construct cannot be specified with a simple rename template. Yate handles this case by allowing you to place Variable 0 through Variable 15 tokens in a template. This allows you to write an action which constructs the special purpose portions of the desired filenames and places them in variables. These variables are then accessed by the template. Let's assume you want to rename the folder containing an album to the album name optionally followed by some text specified at runtime enclosed in square brackets. You could use the following template and action:

――――  Renaming and Restructuring 19


ren19

――――  Renaming and Restructuring Snippet 19

Prompt for Text save to Variable 1, "Specify text to be used when renaming"
Rename Files (Renaming and Restructuring - 19)

When writing an action to rename files you might have a variable which is essentially true or false to be used as a test condition. Similar to the IfExists token, you can use IfTrue and IfFalse tokens with track variables. As an example, assume that the Title is to be followed by the Artist but only if it is not the same as the Album Artist field:

――――  Renaming and Restructuring 20


ren20

――――  Renaming and Restructuring Snippet 20

Test if the Album Artist field is not equal to "\[Artist]" (Set test state and Variable 1)
Rename Files (Renaming and Restructuring - 20)

Here's a tip. When you have actions such as the ones above which essentially simply do renaming, you can place the action on the rename menu. In the Action Manager, select the action and from the context menu choose, Add Association>Rename (or click in the Menu column).


Back to Table of Contents




Testing Expressions

The IfExists tokens allow the testing of existence for various fields. There might be times when you want more complicated test capabilities. The IfExpression token allows you to test an expression. If the expression is true all tokens and text until the next Else or endif token are processed. If the expression is false and there is an Else token, all tokens and text following the Else token are processed until the next Endif token.

Expressions are specified as text immediately following the IfExpression token. All text is parsed up to the next token. If you want to insert text if the expression is true, you'll have to place a break token at the end of the expression.

The following description is virtually identical to the one found in the Rename Template IfExpression Token Expressions help topic.

The syntax of an expression is as follows:

expression slice {and or or expression slice}...

Using and and or constructs, multiple tests can be performed with a single IfExpression token. There is no precedence difference between and and or. The slices are evaluated strictly left to right.

Each expression slice is defined as one of the following forms:

{qualifiers}... item1 text operator {qualifiers} item2
{qualifiers}... item1 numeric operator item2
{qualifiers}... item1 boolean operator

Items

Items can be field references, property references, strings or integer values.

Field references are the name of a field (built in or custom) enclosed in [ ] brackets. Leading and trailing spaces inside the brackets are ignored as is alphabetic case. Typically item1 in an expression will be a field reference. Note that fields can be track variables. Examples:

[Artist] represents the contents of the Artist field.
[track] represents the contents of the Track field.

In the unlikely case that you have a custom field whose name contains a ] character, it can be escaped as ]]. For example a custom field named Abc [#] would be specified as [Abc [#]]].

Property references are the name of a property bracketed by ! ! characters. Leading and trailing spaces inside the ! ! sequence are ignored as is alphabetic case. Examples:

!File Count! represents the number of selected files.
!Has Chapters! will be 1 if the audio file contains chapters, otherwise 0.

Strings can be any text enclosed in double quote characters. If the text contains a double quote character specify it as "". Examples:

"simple text"
"Clarence ""Gatemouth""" Brown"

Integer examples:

5
-1

Note: All fields, properties, track variables, qualifiers and operators can be inserted from the token editor's context menu via the IfExpression Support submenu.


Qualifiers

Qualifiers are case insensitive and can be the following:

any
When the item to the left of the operator is a field and the operator is a text operator, the any qualifier performs the function on every component in the left field. Components are delimited by the multi field delimiter and each component has leading and trailing spaces ignored. The any qualifier is ignored in every other situation.

not
When the expression evaluation is done, the result is flipped. Note if more than one not qualifier is specified, each is applied.

case sensitive
String operators are by default case insensitive. You can use this qualifier to make the tests case sensitive. If more than one case qualifier is specified, only the last is functional. This qualifier is ignored with numeric and boolean operators.

case insensitive
String operators are by default case insensitive. This qualifier is included for completeness. If more than one case qualifier is specified, only the last is functional. This qualifier is ignored with numeric and boolean operators.

Note that qualifiers are reset at the start of each expression slice.


Operators

There are three types of operators: text, numeric and boolean. The following holds:

The following operators are available:



Operator Type Operator Description
Text Equals True if the the two items are equal.
Text Contains True if item1 contains the text in item2.
Text Starts With True if item1 starts with the text in item2.
Text Ends With True if item1 ends with the text in item2.
Numeric == True if item1 has the same integer value as item2.
Numeric != True if item1 does not have the same integer value as item2.
Numeric < True if item1 is numerically less than item2.
Numeric <= True if item1 is numerically less than or equal to item2.
Numeric > True if item1 is numerically greater than item 2.
Numeric >= True if item1 is numerically greater than or equal to item2.
Boolean Is True true if item1 has a non zero integer value or is true. A not qualifier is valid between is and true.
Boolean Is False true if item1 has a zero integer value. A not qualifier is valid between is and false.

IfExpression token expressions immediately follow the token and continue until the next token is encountered. If on true, the first item you want to include is text, you must follow the expression text with a Break token.


Examples

――――  Renaming and Restructuring 21


ren21

The expression is true if the Comments field (default) contains the case insensitive text test note. When true, the Comments field is appended to the filename.

――――  Renaming and Restructuring 22


ren22

This is identical to the previous example with the exception that the comparison is case sensitive.

――――  Renaming and Restructuring 23


ren23

The expression is true if the Artist field does not start with the and ends with space band. When true the word The inserted at the start of the inserted Artist field. When false, leading articles are removed before the Artist field is included.

――――  Renaming and Restructuring 24


ren24

The template is used to rename tracks to dd.tt title. The IfExpression token is used to change disc numbers of 0 to 1.

――――  Renaming and Restructuring 25


ren25

The template is used to rename containing folders to the Album field. If any item in the Genre field is Classical, - (classical) is appended to the folder name. In a rather constructed case, this would work if the Genre field was Folk;;;Classical.

――――  Renaming and Restructuring 26


ren26

The template is used to rename tracks to the Title field. If the file has chapters, - [chapters] is appended.


Back to Table of Contents




Moving or Copying Files to a New Folder Structure

There appears to be an infinite number of folder structures that people use for their collections. Whatever works for you is great. However, here's an opinion. Many people like to separate multi-CD albums into different folders based on the disc number. This is an unnecessary complication. There is a Disc field which when used with the Track field will uniquely identify where the track came from. There are some high end audio players which do not like having albums split into separate folders. Nor do they necessarily handle Album names differentiated by appending Disc 1, Disc 2, etc. We recommend having a single consistant Album field for all tracks in an album. Use the Disc fields as intended. Generally, we feel that life is easier with the one album / one folder approach. However, if you want separate disc folders, go right ahead...Yate will produce them for you.

The actual movement of tracks is done in actions via the Move and Copy Files statements. If you are re-structuring, you will more than likely want to move any non-audio files to the same new folder structure. This is done by the Move Non Audio Files and Copy Non Audio Files statements. These action statements are fully documented within the application.

It is strongly recommended that you use the Create Move Action Wizard to generate actions which can move or copy files. The generated actions can perform runtime validation and cover almost all contingencies.

The wizard generates the action based on a supplied rename template. With the exception of the base path, the entire naming and folder structure is specified in the rename template.

These move actions are created by selecting a single rename template in Settings - Rename and then hitting the blue action button.

The following is a sample rename template designed to move files to a structure defined as follows:

The Alpha folder component consists typically of a single character. This list of single character folders makes it easier to find artists in a large collection. The Alpha token settings are provided in Settings - Rename - Settings. One possibility for settings is as follows:


alphaSettings

All leading characters are ignored except for alphanumeric characters. Digits are not treated as special. While doubtful, any item which does not start with an alphabetic character is placed in an OOB folder.

The rename template supplied to the wizard is as follows;

――――  Renaming and Restructuring 27


ren27

The following example is for those of you who want to use Disc subfolders for multi-disc albums. A single rename template will work with single and multi disc albums.

――――  Renaming and Restructuring 28


ren28

The template only generates a Disc subfolder is a track has a Disc or Disc Count field which is greater than 1. The IgnoreIfEmpty token, causes the entire Folder Start component to be ignored if the multi disc condition is not met.


When using the wizard it is strongly recommended that you do not disable folder validation unless you are intentionally moving content in a single folder to multiple folders. It is always a good idea to enable logging as that way you have a record of where each track was relocated ... even when not batch processing.



Back to Table of Contents




Quick One Off Renaming

If you want to quickly rename the filenames of selected files you can do so from the Multi Field Editor's Rename function. You use the content menu to insert fields which differentiate the filenames. Note that when renaming via the Multi Field Editor, only filenames can be renamed ... ie. not folders. Duplicate handling is always performed. More information can be found in the online help for the Multi Field Editor.



Back to Table of Contents




Summary

The ability to rename and to relocate files is pretty complete. We haven't found any scenario so complicated that Yate could not handle it.



Back to Table of Contents




Document History



Date Version Information
2016-09-17 1.0 First release.
2017-12-10 1.1 Documented the Remove accents template option.
2018-04-03 2.0 Updated for changes in Yate v4
2018-04-08 2.1 Documented the enhanced handling of fields with multiple values.
2018-06-09 2.2 Minor tweak to Move Non Audio example to use newer statements.
2019-09-10 3.0 Changes for Yate v5.0
2020-07-09 4.0 Changes for Yate v6.0
2022-06-07 4.1 Changes for Yate v6.10.2
22-07-06 4.2 Changes for Yate v6.10.5
2023-04-11 4.3 Changes for Yate v6.15
2023-04-30 4.4 Changes for Yate v6.15.1
2023-06-30 4.5 Changes for Yate v6.16
2023-08-14 4.6 Changes for Yate v6.17.1
2024-09-09 5.0 Cleanup and changes for Yate v7.0
2026-01-06 5.0 Updated for Yate v8.4
2026-04-01 9.0 Updated for Yate v9.0. The major and minor version numbers of this document now follow the Yate version.

Copyright ©️ 2016-2026 2ManyRobots.  All rights reserved




Download as PDF



Back to Yate Resources