(*
So I have been counting on the Finder to throw an error if I try to rename a file to a name which already exists in the same folder. But it appears that is not what happens. It simply silently ignores the rename command. I am I missing something? This doesn't seem right.
*)
try tell application "Finder" set firstFile to make new file at desktop with properties {name:"firstfile"} set secondFile to make new file at desktop with properties {name:"secondfile"} set duplicateName to name of firstFile set the name of secondFile to duplicateName set newName to name of secondFile if newName = duplicateName then display dialog "WTF?" end if end tell on error errMsg number errNum display dialog "Error " & errNum & ": " & errMsg end try --> name of secondFile is not changed and no error is thrown
Steve ------------------ OS X 10.6.8, AppleScript 2.1.2
|