Completely new to Scripting/this Forum, need some help

I need to batch rename folders of .eps files to .ai files. What would be the quickest way to do this? I tried this…

set sourceFolder to (choose folder) as string
tell application “Finder” to set name of files of entire contents of folder sourceFolder whose name extension is “eps” to “ai”
display dialog “Rename Complete”

but it didn’t work, it kept putting a command type ai file in the folder and wouldn’t run.

Welcome. :slight_smile:

Try something like this:

choose folder with prompt "Rename .eps files in this folder (and subfolders):"
set sourceFolder to result

tell application "Finder"
	set fileList to files of entire contents of sourceFolder whose name extension is "eps"
	
	repeat with thisItem in fileList
		set name of thisItem to (text 1 thru -5 of (get name of thisItem)) & ".ai"
	end repeat
end tell

display dialog "Rename Complete"

Thank YOU Bruce! :smiley:

that worked perfectly. okay I guess the next step is for me to figure out how to write some scripts.:rolleyes:

like I said, I am completely new to Applescripting.

Thanks again!
~Nate