Application icon

Move or Copy Files

These statements are used to move or copy files to a calculated path.

Choose if you want the files relocated to a specified base path or to a base path relative to the folder containing the file being moved. Relative paths are specified by the number of levels up from the file's containing folder. Zero levels implies that the new folder structure should be in the files's containing folder. One level implies that the new folder structure should be in the parent of the file's containing folder, etc.

At runtime the path must resolve to be:

Warning: be careful when moving or copying files beneath the original folder while batch processing! If you are moving or copying files into a folder which has already been marked for traversal, it is possible that the files will be processed multiple times.

Choose up to three fields to be used as folders to be appended to the absolute or relative base path. When the path is constructed if you specified Album Artist and the field is empty, Artist will be used. If the value associated with a chosen field is empty an error will be issued unless a placeholder is specified. Note that if a non empty placeholder is specified and a field is not specified, the placeholder will be used. This allows the specification of a fixed value for a path component. The use of these fields is entirely optional as folder path components can be constructed in a rename template used to define the filename.

Transformations can be applied to each of the three fields to be optionally appended. To configure the transformations press the Transformations... button. A panel will be displayed containing the transformation settings. Close the panel by clicking off the panel or by pressing the Escape key. For more information see Statement Transformations.

You can also elect to specify a rename template. If a template is not specified, the original filename will be appended to the destination path. If a template is specified it will be applied. If the template contains one or more Folder Start tokens, the constructed folder paths will be appended to the path. The constructed filename with the original filename extension will then be appended to the path. The rename template can be chosen from the popup list or manually entered. The only reason to manually enter the template name is if you wish to specify the name at runtime.

Be aware that while Rename templates can be used, the Move statement is attempting to move the files...not to rename them. The Rename statement's logic goes much farther to force a rename than when moving. If the execution of a Move statement effectively ends up being a rename, it is possible that the process will fail. This depends on if the volume is case insensitive (typically it is) and if the Rename template has duplication handling. The preceding explanation is also true for Copy Files which attempts to copy, not rename the files.

To summarize the destination location is calculated as follows:

Yate, will create the final path if it doesn't exist.

With the Move statement, you can specify that you want the original folder to be deleted after the move if it is empty. Check the Delete empty folder option. Additionally if you delete the original folder you can delete an empty parent folder as well by checking the and empty parent option.

By default, the function will always be performed. You can specify to only perform the function if it is part of a compilation or not part of a compilation. This facilitates having two different back to back Move steps. One which handles the non compilation state and one which handles the compilation state.

You can specify what to do if a file already exists at the destination. You can choose to perform the default operation or to skip the move/copy or always replace the existing file. The default operation while not Batch Processing is to be presented with a dialog where you can choose what to do. The default operation while Batch Processing is to log an error message. Note that while Batch Processing, default and skip are identical.

The function sets the Retained Path 1 property to the new path on success. The Retained Path 2 property is set to the original path on success. On failure, both properties are emptied.

All text fields may contain any of the escape sequences described in Escape Sequences.

You can preview the function's application based on the files currently selected in the main window. The results are displayed in the Log Viewer.

At times, you may have to decide at runtime if you want to move or copy files. The Move statement has an Allow runtime override setting. If the setting is enabled and named variable Override Move to Copy is true (non zero integer or "true"), the Move statement will effectively become a Copy Files statement. When overridden the folder deletion settings will be ignored. Note that the Move Non Audio Files statement can also overide its functionality at runtime and uses the same named variable.


Runtime Previews

If a track variable is chosen for runtime preview, no moving/copying or modification of the Retained Path # properties takes place. The function is applied for each selected file and the resultant path is saved to the specified track variable. This is useful if for any reason you want to see the effects of a move/copy prior to actually performing the function. In the case of an error, the track variable's contents will not begin with a / character and may contain text describing the error.

Note that IfDup sequences in a rename template are not processed.

The following example shows how to do a preview and test the results:

Move to \<basepath>/[my rename template], preview to Variable 1
Test if the Variable 1 field does not start with "/" (Set test state and Variable 2)
if Variable 2 is true
    ' These files had errors
else
    Remove the last path component in Variable 1
    Test if Variable 1 is the same in every file, Set result
    if true
        ' These files have a consistent path
    else
        ' These files do not have a consistent path
    endif
endif