Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Change a file name with Applescript?

I currently have the script:


tell application "Finder"

set the name of file "/Users/rileylloyd/Desktop/Scan.jpeg" to "/Users/rileylloyd/Desktop/Scan.jpeg.bak"

end tell


and I get the error:


error "Finder got an error: Can’t set file \"/Users/rileylloyd/Desktop/Scan.jpeg\" to \"/Users/rileylloyd/Desktop/Scan.jpeg.bak\"." number -10006 from file "/Users/rileylloyd/Desktop/Scan.jpeg"


what am I doing wrong? is there an easier way to do this with "do shell script" maybe?

MacBook Pro, OS X Mountain Lion (10.8.1), 2.3 GHz i5, 4GB RAM, OCZ 120GB SSD

Posted on Dec 21, 2012 12:44 PM

Reply
Question marked as Best reply

Posted on Dec 21, 2012 1:02 PM

Here:


tell application "Finder"

set name of file "Scan.jpeg" of desktop to "Scan.jpeg.bak"

end tell


(72944)

8 replies

Nov 6, 2013 6:45 PM in response to twtwtw

Kinda late to the game, but I thought I'd give a "Thanks a lot" to twtwtw. Your tip fixed all the issues I was having with a backup script I was working on. Kudos.

Change a file name with Applescript?

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