Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

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
3 replies

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.

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.

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 ID.