Metadata From CSV
The script reads CSV spreadsheet data for file names and metadata, searches a selected folder for the files, and updates the metadata.
This script is an expansion of the Photoshop script Keywords from CSV. For keywords only, consider this related script, as it has the additional options of adding keywords, replacing keywords, or removing keywords.
Update unique metadata for each file
Include subfolders
Match name exactly or without extension
The script requires a spreadsheet of file names and metadata, saved as Comma Separated Values (CSV format). The spreadsheet must have at least two columns, one for image file name, and another for at least one field of metadata.
The first row is the header, which identifies the contents of each column. In this example, the column for file is labeled File name, and remaining columns are fields of metadata. Each row contains the file name in the first column, and the metadata in the remaining columns. These columns could just as well be labeled "image" and any other label for each metadata field. The precise column labels, or their order, are not important, and there is no harm in extra columns. Which column is the file names, and which are metadata fields, are selected in the script interface.
Image file names do not need the full path, only the file name. In the script interface, the folder where images are located is selected, and its path is added to arrive at the actual location of each image. If file names are only base name (file name without extension), be sure to enable the script option Match file name only, without extension, described in the section How to use the script, section 2 Images folder.
The column for keywords contains one or more keywords. Separate multiple keywords with a comma or semicolon.
The interface has two sections: Data file, and Images folder. Select the data file, the columns to use, and the images folder. Enable the desired options, and click the OK button to begin. A progress bar is displayed while processing. When complete, the number of images processed is reported. If problems occur, a log file is written at the location of the data file and the user is notified.
File — select the CSV data file, then the column drop-down lists (next) are loaded with the columns discovered in the data.
Column file name — select the column of image file names.
Columns of metadata fields — in each drop-down list, select the column that contains the desired metadata value to write to each image. Below are the available metadata fields the script can write to images:
When selecting columns of metadata, at least one must be selected. Any that are not set are ignored, and the script does not search the data for the column, and does not write to that metadata field.
For each column of metadata selected, the values from the data replace any existing metadata, provided the data cell is not empty. Because the script ignores empty cells, it is possible to write a metadata field for some images, but not others. For example, if the description column contains values for most images, but if some rows (images), the description cell is empty, for that image, that metadata field is ignored. Any existing value remains, rather than having it removed by replacing it with the empty value of the cell.
Match file name only, without extension — enable to match any file extension, or if the file name column lists only the base name (file name without extension). When enabled, file names with different extensions are considered a match, and are processed.
Include subfolders — files within subfolders are included in the search for images to process.