Hello,
I am trying to rename a file. In OS9, something like this would work to rename a file “data disk:aaaa” to “data disk:bbbb”
tell application "Finder"
set oldfname to "aaaa"
set newfname to "bbbb"
set fulloldname to "data disk:"&oldfname
set fullnewname to "data disk:"& newfname
set name of file fulloldname to fullnewname
end tell
When I try this in OSX, I get the error, “Can’t set name…”. If I just say to select the old file, that does work.
Any ideas what’s going on here?
No, it’s not that. You can refer to files using the path, but the “name” of the file cannot contain a colon. Maybe this is what you need:
tell application "Finder"
set oldfname to "aaaa"
set newfname to "bbbb"
set fulloldname to "data disk:" & oldfname
--set fullnewname to "data disk:" & newfname
set name of file fulloldname to newname
end tell