Scripts and Batch Processing
Options > Scripts & Batch Processing opens a window for recording and running scripts in the Edit View. A script is a list of commands that runs in order. The window stays open while you work, so it can record what you do.
Collections
Scripts live in a collection. The collection's name shows above the list, or (none loaded).
- Open / New Collection asks for a name. Type a name to start an empty collection. Leave it empty to open a Cool Edit script file (
.scp). A file that can't be read shows its error and leaves the open collection as it was. - The app keeps every collection in the browser and opens the last one again next time. To go back to another saved collection, type its name at Open / New Collection.
- Click a script's title in the list to see its description. To remove a script, save the collection with Edit Script File, delete the script from the file, and open the file again.
Recording a script
- Type a Title and click Record.
- Do the work: cut, copy, paste, reverse, silence, switch the edited channel, and run effects. The window records each one, with the selection it ran on.
- Click Stop Current Script.
- Write what the script does in the box at the bottom, then click << Add to Collection <<. The script is saved with the collection. If none is open, the app starts one called Scripts.
Clear drops a recording you don't want.
The app records an effect with its settings, so the script runs it without asking. Scripts recorded here run in this app. Cool Edit can't read the effect settings, but the rest of a collection stays in Cool Edit's format.
Commands with no script name, such as zoom and play, aren't recorded.
The three modes
A script works in one of three modes, set by what is open when you click Record. The dark label under the list shows the mode of the script you picked or are recording.
- Script Starts from Scratch: no wave is open.
- Script Works on Current Wave: a wave is open with nothing selected.
- Script Works on Highlighted Selection: a range is selected.
Run Script is greyed until the selected script's mode matches the open wave: open a wave, select a range, or clear the selection to match.
Running a script
Pick a script and click Run Script. The steps run one after another. Scripts run in the Edit View only. If a step fails, the script stops and says which step and why.
- Pause at Dialogs: an effect opens its dialog, on its own defaults, and the script waits until the effect you run from it is done. Closing the dialog without running stops the script.
- Alert when complete: shows a message when the script ends.
- Execute Relative to Cursor: moves each recorded selection to start at the cursor.
The three boxes keep their state between visits.
A command the app doesn't have stops the script with "This command isn't in the app", followed by its name. An effect from a Cool Edit script file, which has no settings the app can read, opens its dialog.
Saving a collection as a file
Edit Script File downloads the open collection as a .scp file, to keep or to edit in a text editor. Open it again with Open / New Collection.
Batch Process
Batch Run runs the selected script on a list of files and saves each result. It works with a Script Works on Current Wave script, and stays greyed while a script records or runs. It opens the Batch Process dialog.
- Click Add Files... to pick the audio files. The list holds up to 1000 files. To take files off the list, select them and click Remove.
- Click Browse... to pick the folder the results go to. In a browser that can't write to folders, the Folder field reads Downloads and each result downloads instead.
- Set the Output Filename Template and the Output Format.
- Click Begin.
The dialog closes, and the files run one at a time. Each file opens in the Edit View, the script runs on it, the result is saved, and the file closes again. A progress window shows how far the batch has got. Cancel stops the batch before the next file, and the file it was working on isn't saved. If a file can't be read or its script stops, the batch notes why and goes on with the next one. A batch can't answer dialogs, so a script step that needs one fails the file. That covers New, New Sample Rate, Convert, Generate Silence and an effect recorded without its settings. When two files would get the same output name, the second fails. At the end, the status bar counts the files saved, skipped and failed, with the reasons for the failures. The file that was open before comes back.
Batch Process runs in the Edit View only.
Naming the results
The template sets each result's name from its source file's name. Both are split at the last dot into a name and an extension, and each half of the template is filled in on its own:
*puts in the whole matching half of the source name.?puts in the one source character at that same position, or nothing when the source is shorter.- Any other character stays as it is.
For example, with a source file called interview.mp3:
*.wavgivesinterview.wav.clean-*.wavgivesclean-interview.wav.?????.*givesinter.mp3.
A template with no dot gives names with no extension. A file whose name would come out empty, or would hold /, \ or :, fails and isn't saved.
The template starts as *.wav. Choosing another Output Format changes the template's extension to match, as long as it still had the old format's extension.
Output formats
WAV, FLAC (.flac) and MP3 (.mp3) are always there. MP3 is saved at 192 kbps, and a file at another rate is converted to 32, 44.1 or 48 kHz, as Save As does. Ogg Opus (.opus) and M4A AAC (.m4a) are listed when the browser can encode them.
Format Options and Scan List
Scan List reads every file in the list and shows each sample format it found, such as 44100 Hz, Stereo, 16-bit, with how many files have it. A file it can't read gets a row of its own.
Overwrite existing files
When Overwrite existing files is off, a file whose result name is already in the folder is skipped. When it's on, the old file is replaced. It has no effect when the results download.
Greyed
- Change Options... stays greyed: the app's output formats have no settings to change.
- Disable Undo stays greyed: each file closes once it's saved, so no undo is kept anyway.
- Open Raw PCM As... stays greyed: the app doesn't open raw PCM files.