Use this sub action to rename files that you send to a workflow.
The Rename file sub action makes it possible to rename files or change their file extension. The naming of files can be based on information in XMP or EXIF fields or specific file properties. It is also possible to add running numbers to files to ensure that all files are correctly renamed and given a unique name. If files in your archive have the same filename as the file being renamed, but with a different file extension, the Rename file sub action can be configured to also rename these files. This functionality is useful for accompanying files such as text files containing metadata and other types of information.
To set up the automatic renaming of files, decide whether the action should change the actual filename (choose the Change filename to option) or only the extension of the files (choose the Change file extension to option).
Changing the file name
Enter a new file name in the text field to rename a file. When renaming several files in a single operation, you must add some extra information to avoid duplicate file names. There are two ways to do so:
- add a running number to the files
- add information from a file’s XMP or EXIF fields or file properties, provided that this information is unique for each file.
Adding running numbers
There are two ways to add a running number to file names:
- start numbering the files from number 1 onwards
- prompt the user for a starting number
Both methods require you to insert the %%INSFNUMBER operator in the b field. The %%INSFNUMBER operator is one of many dynamic operators. See Dynamic operators.
By inserting the %%INSFNUMBER operator into the Change filename to field, FotoStation will start renaming the files. The number 1 is added to the first file and the numbering continues until all files have been renamed. You can choose where in the file name the running number should appear. It can be inserted before, after, or even in the middle of the new filename.
For instance, you can enter the following in the Change filename to field:
When processing files with the action, the renamed files will be called 1_Summer2014, 2_Summer2014, 3_Summer2014 ,and so on.
By prompting for the start sequence number
The advantage of prompting the user for a starting number is that you can choose to add leading zeros and you can choose which number should be the first running number in the renamed files.
When you select Prompt for the start sequence number every time the action is started, FotoStation will display a dialog box that enables you to set the start number for the renaming sequence every time you run the action. Since the number directly substitutes the %%INSFNUMBER operator entered into the Change filename to field, it is a good idea to add a dash or an underscore after the static part and before the %%INSFNUMBER part of the filename, for example, Newfile_%%INSFNUMBER.
This way, the underscore separates the file name you choose from the running number, and if you, for example, choose 001 as the start number when prompted, the files will be renamed to Newfile_001, Newfile_002, Newfile_003, and so on. The files' current extension will be preserved.
Prompting for the filename of each processed file
To have FotoStation prompt the user for the filename of each asset that is processed in the action, enable Prompt to edit each filename. This opens a filename dialog for each file processed in the action and asks the user to approve the existing filename or rename the file before the sequence continues. The resulting filename can be used as the basis of additional sub actions in the Action chain of events.
To rename files according to metadata field content or file information, select Insert code. This allows you to choose from all available XMP and EXIF fields and file properties to build a unique file name. For example, by choosing #005 Object Name under XMP fields, FotoStation will use the information in the Object Name as the file name.
You can combine the contents of several fields, for instance:
This combines the content of the Object Name field with the EXIF Date and Time field. Underscores or dashes can be inserted in the text field to separate one entry from another.
Note that all dynamic operators are available by selecting Insert code. You can also insert the running numbers dynamic operator %%INSFNUMBER by selecting Insert code.
Tip: It is always a good idea to add a sufficient number of leading zeroes when renaming files using running numbers. This ensures that FotoStation sorts the files correctly when you choose to sort by file name, for example when viewing the files in thumbnail view.
Including accompanying files in the renaming operation
Sometimes, files in an archive are accompanied by a second file that contains additional data about the file (metadata). Provided that such files, commonly referred to as “sidecar” files, have the same name as the file they accompany (extension aside), the Rename file sub action can rename the sidecar files automatically when renaming the master file. This is done by selecting Include additional files with same name and other extension.
When renaming, for example, image001.jpg, the sidecar files image001.txt, image001.inf, and image001.doc are also renamed. There is no limit to how many sidecar files a file can have; any file with the same name as the file being renamed is also renamed.
Note that renaming of XMP sidecar files containing metadata is automatically handled by FotoStation whether this option is enabled or not.
Changing the file extension
The Rename file sub action can also be used for changing the extension of files. Changing the file extension might open the file in another application since both Windows and, to some extent, Mac OS rely on a file’s extension to determine which application it should open in.
To change the extension of the files processed by the action, select Change file extension to and enter a file extension in the text field below, omitting the dot. Typically the file extension is three characters long, but you can have a longer or shorter extension if you like.