Re: Error -43
Re: Error -43
- Subject: Re: Error -43
- From: kai <email@hidden>
- Date: Sun, 13 Mar 2005 14:39:14 +0000
On Sat, 12 Mar 2005 23:24:17 -0500, "P. Medland" wrote:
Here is a script that runs but not all of the time. Both folders
exist but
sometimes the script errors out on -43 when other times it runs.
tell application "Finder"
activate
duplicate folder "MacVol:QT_Backup:00084127.Z:" to folder
"PowerMac
G4:" with replacing
end tell
I changed to "duplicate folder" from "copy folder".
The script doesn't start when it does die. It immediately returns
-43. I
can run this is Script Debugger until it eventually works.
I have another application that I am programming in which does the
copies
faithfully 100% of the time when this script here returns -43.
I was reading somewhere about some bug in applescript which might
cause this
-43 error. Has anyone else heard of this?
OSX 10.3.8
I can't tell you anything about a possible bug, Paul - but I wouldn't
normally expect to see too many cases of error number -43 in this
context. In fact, there's not that much in the script to go wrong -
apart from a suspect path, which you've already said is not the case.
In this sort of situation, I'd be less surprised to see something like:
errOSACantAssign:
-----------------
Error number: -10006
Description: Returned when an object can't be set in a container.
Reported as: "Can't set [item x] to [item y]."
errAENoSuchObject:
-----------------
Error number: -1728
Description: Usually arises when trying to get an object outside the
range of those available.
Reported as: "Can't get [item x]."
What you're actually getting is:
fnfErr
------
Error number: -43
Description: File not found.
Reported as: "File [x] wasn't found."
If your script was longer, I might be looking elsewhere in it for the
problem. (Forgive the question - but it's not an extracted snippet, is
it?) A common cause of this type of error is a failed attempt to coerce
a non-existent path to an alias:
-----------------
try
"????" as alias
on error e number n
e & " (Error number: " & n & ")"
end try
--> "File ???? wasn't found. (Error number: -43)"
-----------------
In terms of possible fixes, I'd favour using aliases rather than paths.
(Just replace <folder "xyz"> with <alias "xyz">.)
Another possibility, especially if you're working with a volume that is
not permanently connected, might be getting the Finder to update before
attempting to duplicate. For example:
-----------------
tell application "Finder"
update {startup disk, disk "MacVol"}
-- continue with rest of script
end tell
-----------------
This asks the Finder to immediately make new items show up in the
correct position and to update the desktop database - a job otherwise
left until processing time is available.
---
kai
_______________________________________________
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