Re: Script errors with empty file reference
Re: Script errors with empty file reference
- Subject: Re: Script errors with empty file reference
- From: Brett Conlon <email@hidden>
- Date: Wed, 29 Aug 2007 18:04:51 +1100
That's the strange thing tho. RESOURCES
is a server volume and unless someone else physically has that eps file
opened on their Mac (which is highly unlikely as 98% of the studio have
read only access) the only other reason I can think of is that it could
be busy is if it is still in the process of being copied - and remember
that it works for that same job the second time and then fails again on
the next job being processed.
Thanks for the error trap. I'll give
that a go.
Actually, can anyone clarify something
here? If I have, say, a folder of 5 X 100MB files and a repeat is having
"Finder" move these files one at a time to another location,
does the repeat wait until file 1 has finished copying before is sends
the message to Finder to start copying file 2? I'm guessing it does but
just want to check.
Ta muchly,
Coj
Ed Stockly <email@hidden>
Sent by: applescript-users-bounces+brett.conlon=email@hidden
29/08/07 02:04 AM
|
To
| email@hidden
|
cc
|
|
Subject
| Re: Script errors with empty file reference |
|
Brett,
(*alias RESOURCES:FOX RESOURCES: ? BASE ARTS:SLICKS/GENERIC:TCFHE:TCFHE
DVD SLICKS:EPS Files:DVD LOGO WHITE.eps*)
current application
"Finder got an error: The operation could not be completed
because the file ?? is in use."
The error message indicates the file is still open on
the user's mac. Possibly during unstuffing?
I'd suggest adding a try block and a delay.
Here's a version that traps an error, waits 5 seconds,
then tries two more times, then gives up.
on moveItems(Sources,
destination)
log Sources
tell application
"Finder"
repeat with
ThisBit
in Sources
set errorcount
to 0
repeat
try
log ThisBit
duplicate
ThisBit
to destination
with replacing
on error
errText
number
errNum
set errorcount
to errorcount
+ 1
if errorcount
= 3 then
log "Error:
" & errText
& return
& errNum
& return
& ThisBit
display dialog
"Error: " & errText
& return
& errNum
& return
& ThisBit
buttons
{"OK"} default button
1 giving up after
5
exit repeat
end if
delay 5
end try
end repeat
end repeat
end tell
end moveItems
You may also consider getting the size of thisBit, delaying
a few seconds, getting its size again, and if the size hasn't changed,
then duplicate it.
HTH,
ES
= _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden