• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Error -43
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Scripting Energy Saver to Sleep Display Now?
  • Next by Date: Re: Scripting Energy Saver to Sleep Display Now?
  • Previous by thread: Error -43
  • Next by thread: new user
  • Index(es):
    • Date
    • Thread