I am trying to change the name of a file. Seems simple enough, if one is able to change the "displayed name" property. But I keep getting this error:
Can't set displayed name of alias "Path:to:file:" to "New_name"
Here's the folder action script I'm using (i.e. saved applescript, then used folder action setup service to assign it to my folder):
on adding folder items to this_folder after receiving these_items
try
repeat with this_item in these_items
tell application "Finder" to set displayed name of this_item to "New_Name"
end repeat
on error error_message number error_number
display dialog error_message buttons {"Cancel"} default button 1 giving up after 120
end try
end adding folder items to
All the scripts I'm finding that does something similar (e.g. this question) first get the "name" property then strip the extension. I'd rather just go straight to the "displayed name" property.