Batch rename .PDF files with Automator and a .CSV list

I am trying to set up Automator to rename .pdf files based on a .CSV list using the instructions and script found in this discussion from 2020:


Batch file rename from excel spreadsheet - Apple Community



The .pdf files to be renamed are in the folder with a 2 column cvs file, comma delimited, with two columns of text strings, one column matches the current name of a .pdf file, the second contains the rename text string. However it will not return a name file. See screenshot below.


Can anyone help me fix this? Could it be because my current OS, 13.0.1 (22A400) and my Automator Version 2.10 (520) are no longer compatible with this code from 2020? Any troubleshooting help would be greatly appreciated. Thanks much in advance.


MacBook Pro 13″, macOS 13.0

Posted on Apr 29, 2024 11:27 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 29, 2024 1:00 PM

In your Automator workflow and the Run Shell Script action, change pass input: from stdin to as arguments. That change alone and using your CSV, and filenames in a Rename PDF folder works fine for me on macOS Sonoma 14.4.1 — without any other changes.

Similar questions

3 replies

Apr 29, 2024 11:48 AM in response to lrpedretti

Show me the first five lines of your CSV file, including any header if one is present. The script does not expect a header row, or any filenames with commas in them.


Is the CSV file located in the same folder as the files to be renamed? Is it named titles.csv or some other name, and if so, did you change the CSV name in the shell script to match the different CSV file name in the folder?


Did you run the Automator solution twice? If so, no files would be renamed and did you get any dialog out of the Run AppleScript action?


You need to update your Mac from macOS 13.0.1 to the current 13.6.6 if for no reason other than bug, security, and performance fix reasons.

Apr 29, 2024 12:22 PM in response to VikingOSX

Here are all the lines of my CSV file (once the Script works, I'll add the rest:


titles.csv is in the same folder as the pdf files to be renamed, i did not rename the CSV in the shell script, it remains "titles.csv":


I've run the script more than once while testing and trying to trouble shoot myself. No files names have changed, unless they end up somewhere other than in the folder "Rename PDF"


I will update my system, thanks. And many thanks for your help - I need this to rename a batch of about 30 files each month, it would avoid a lot of human error if I could automate this task.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Batch rename .PDF files with Automator and a .CSV list

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.