Change file name

I am trying to change the name of a desktop file:


tell application "Finder"

       set name of file "Thursday DATE.png" of desktop to "DATE.png"

end tell





I get the following error:

 

error "Finder got an error: Can’t set file \"Thursday DATE.png\" of desktop to \"DATE.png\"." number -10006 from file "Thursday DATE.png" of desktop

 

Thanks for any help




iMac Line (2012 and Later)

Posted on Jul 10, 2020 10:57 AM

Reply
3 replies

Jul 10, 2020 11:36 AM in response to VikingOSX

I am not sure what I did wrong but, if you would allow me to ask this:

I need an AppleScript that will change the name of the file no matter which day of the week is in the prefix and change the file to DATE.png. This would include every day of the week. So, by example Sunday DATE.png would become DATE.png and so on


There would always be 1 file on the desktop but the day of the week in its name would be different.

Thanks

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.

Change file name

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