-
-
Save bzerangue/b3cd3211aeecde0ce0a73545baa97a75 to your computer and use it in GitHub Desktop.
Bulk rename files with csv file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Store the .csv file in the same directory as the files you wish to rename | |
-- Replace 'username' in the path with your own (lines 3 & 10) | |
set csvFile to "/Users/username/Documents/index.csv" | |
set csvList to paragraphs of (read csvFile) | |
set {theID, my text item delimiters} to {my text item delimiters, ","} | |
repeat with csvLines in csvList | |
set {oldName, newName} to text items of csvLines | |
tell application "System Events" | |
set name of file oldName of folder "/Users/username/Documents/" to newName | |
end tell | |
end repeat | |
set my text item delimiters to theID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment