# Batch Processing, the Batch Processor Wizard & Data File Processing

Yate supports batch processing operations. Basically an action can be successively run over a folder and all of its nested subfolders.

The wizard will step you through the process. You choose an action and a root folder. There are two options:

The Auto save files option will automatically save any unsaved changes to the files when the selected action terminates. This is useful when the selected action does not contain a Save function. Actually, saving from the wizard is a better method of saving the files as it will be somewhat faster than a contained Save function.

The Verbose log option will cause additional information to be placed into the log file. By default, only information that would have appeared in a popup pending action window is logged. In addition whenever a folder is renamed, the information is always logged. When the verbose option is checked, all file saves, all renames and adds to iTunes are logged.

In the log file, folders are identified in as: Folder: /path. If you copy the /path specification to the system clipboard, you can load the folder by selecting the File>Open Path in Clipboard menu item. This may by easier than navigating in the Finder to the desired folder.

The supplied action is run individually over every folder containing audio files. You can design the supplied action to partially execute before any folders are processed and after all folders have been processed. If your supplied action contains an inline action named Batch Start it will be executed before any files/folders are processed. If the supplied action contains an inline action named Batch End it will be executed after all files/folders are processed. A dummy audio file will be supplied to enable the actions to run. However, the intent of the special inline actions is to initialize information for, and to present final results of a batch run.

Note that the special inline actions are always run stepwise even if the supplied action starts with a Force Grouped statement.

The Batch Processor automatically sets four named variables before executing Batch Start, the main portion of the action and Batch End. The variables are:

> Batch Root Folder
>   The folder passed to the Batch Processor.
> Batch Auto-Save
>   1 if the Auto-Save Files option was selected, 0 otherwise.
> Batch Verbose
>   1 if the Verbose option was selected, 0 otherwise.
> Batch Phase
>   This variable describes the phase of the process in which execution is occurring. There are three values:
>   - 0 executing Batch Start.
>   - 1 executing over the folder structure.
>   - 2 executing Batch End.

### Data File Processing

Data File Processing is a special mode of the Batch Processor. It is used when you want to parse a data file which contains references to files and associated metadata to be applied to the files. In this case a root folder is irrelevant as all the files to be processed are described in the data file. In order to run in this mode simply drag the data file (.txt, .csv, .log, .tab or .tsv) to the target, as opposed to a root folder. A single dummy file will be processed by the action. The following processing is done before the action starts:

- The full path to the data file is placed in named variable Batch Data File. If the variable is not empty, the batch processor is being run in Data File Processing mode.
- The contents of the data file will be in named variable Batch Data File Contents.

### Query Database Processing

Query Database Processing is a special mode of the Batch Processor. It is used when you want to open a database for querying but have no need to walk a folder heirarchy. In order to run in this mode simply drag a database sidecar file (.plist) to the target, as opposed to a root folder. Yate will attempt to locate an associated database file of the same name with a .csv, .tsv or .tab filename extension. If the file is located it will be opened as if opened via a Open Database for Querying action statement. The database will be opened with the In file mode. This means that you must have set the key column in the Database Viewer before running the process. A single dummy file will be processed by the action. The following processing is done before the action starts:

- The full path to the query database (plist) file is placed in named variable Batch Query Database. If the variable is not empty, the batch processor is being run in Query Database Processing mode.

### Applying Metadata from a CSV/TSV File

The Apply Track Database Metadata Changes wizard is a special form of the Batch Processor which can be used to apply the metadata contained in a CSV/TSV database to referenced tracks.

Additional topics

Actions

Apply Track Database Metadata Changes

Query Databases