error code 2 when renaming file
error code 2 when renaming file
- Subject: error code 2 when renaming file
- From: Craig Knelsen <email@hidden>
- Date: Tue, 7 Dec 2004 13:22:26 -0600
I'm attempting to rename a file (backing it up before updating) similar
to the following:
set someFile to "My HD:Users:johndoe:Library:someApp:something.dat"
set newName to "something_old.dat"
try
tell application "Finder" to ¬
set the name of (someFile as alias) to newName
... opens someFile and writes to it ...
on error errorMsg number errNum
display dialog "Rename failed: " & errorMsg & " (" & errNum &
")"
end try
It works most of the time but I sometimes get an error message "The
operation could not be completed (2)"
Ok, so why? The Finder might as well have told me "not today". How can
I get more information on the root cause?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden