• 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: Script errors with empty file reference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script errors with empty file reference


  • Subject: Re: Script errors with empty file reference
  • From: Ed Stockly <email@hidden>
  • Date: Tue, 28 Aug 2007 09:04:36 -0700

 


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

  • Follow-Ups:
    • Re: Script errors with empty file reference
      • From: Brett Conlon <email@hidden>
  • Prev by Date: Re: InDesign CS2, Polygons, and madness
  • Next by Date: why this error under 10.2: Expected expression but found "property"
  • Previous by thread: Script errors with empty file reference
  • Next by thread: Re: Script errors with empty file reference
  • Index(es):
    • Date
    • Thread