Metadata From CSV

Script for Adobe Photoshop
Latest update 12/11/2023, version 4.1

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
  • Process any number of images
  • Include subfolders
  • Match name exactly or without extension
Metadata From CSV
Help me keep making new scripts by supporting my work. Click the PayPal button to contribute any amount you choose. Thank you. William Campbell

How-to Video

Before using the script

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.

Metadata From CSV example spreadsheet

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.

How to use the script

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.

Section 1: Data file (CSV)

Delimiter — the character that separates columns of the data file. The default is comma, normal in the United States. Some European countries use semicolon rather than comma. Select the delimiter used in your region of the world.

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:

  • Copyright
  • Creator
  • Description
  • Headline
  • Keywords
  • Title

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.

Section 2: Images folder

Folder — select the folder of images to process. Each image file name in the spreadsheet data that is found in this folder is processed.

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.

Help me keep making new scripts by supporting my work. Click the PayPal button to contribute any amount you choose. Thank you. William Campbell
Metadata From CSV

Change log: metadata-from-csv.txt

For help installing scripts, see How to Install and Use Scripts in Adobe Creative Cloud Applications.

IMPORTANT: scripts are developed for the latest Adobe Creative Cloud applications. Many scripts work in CC 2018 and later, even some as far back as CS6, but may not perform as expected, or run at all, when used in versions prior to 2018. Photoshop features Select Subject and Preserve Details 2.0 definitely fail prior to CC 2018 (version 19) as the features do not exist in earlier versions. For best results use the latest versions of Adobe Creative Cloud applications.

IMPORTANT: by downloading any of the scripts on this page you agree that the software is provided without any warranty, express or implied. USE AT YOUR OWN RISK. Always make backups of important data.

IMPORTANT: fees paid for software products are the purchase of a non-exclusive license to use the software product and do not grant the purchaser any degree of ownership of the software code. Author of the intellectual property and copyright holder William Campbell retains 100% ownership of all code used in all software products regardless of the inspiration for the software product design or functionality.