Re: Copy file across volumes
Re: Copy file across volumes
- Subject: Re: Copy file across volumes
- From: "Gary (Lists)" <email@hidden>
- Date: Thu, 28 Jul 2005 11:25:41 -0400
"Simon Forster" wrote:
> If I get the Finder to copy the files, occasionally I've received a
> "Finder is busy" message. I suppose I could trap for this error but
> then how?
>From least specific to most...
To "trap" for an error, you use a 'try...on error...end try' block of code.
try
tell app "Finder" to -- do some stuff
on error errMsg_ number errNum_
return {errNum_, errMsg_}
-- or whatever else
end try
Okay, that's that. But, in your case, when you are copying a file, what you
probably want to do is to wait until the file is finished before moving on.
To do that, you don't need the Finder. Use the 'busy status' property of
the file information record you get from the 'info for' command.
tell app "Finder" -- to do some copying with 'f'
...
repeat until busy status of (get info for f) is false
-- wait, twiddle thumbs
end repeat
OR
repeat while busy status of (get info for f) is true
-- wait, twiddle thumbs
end repeat
Both of those repeat formats work for me, X.3.9. That may work for your
application as well.
--
Gary
_______________________________________________
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