Apple event timed out error

Hello all,

I am running os 9.1 and Applescript 1.8.3 on a beige G3 with 288mb ram.

A script I am running sends lots of files to the trash when it is done processing them. I have

tell application “Finder”
empty trash
end tell

at the very end of my code to clean things up before the next run of my processing. For some reason (one which I have not yet been able to fix) the trash empty on this machine is very very slow, ~ .5 to 1 second per 60k image file. As a result I get a “Apple event timed out.” error during the trash empty.

Questions:

  1. is there a way to set thresholds on apple event time? Can I extend the time as a getaround to the error?

  2. I know this is outside the range of apple script topic (sorry administrators, might be helpful to others?)
    Has anyone run into this slow trash empty thing before? Know any fixes?

I regularly empty the trash.
I have tried

  1. rebuilding the desktop
  2. trashing finder and system preferences and rebuilding desktop
  3. running norton antivirus disk scan, no errors found
  4. disabling the norton extensions

Thanks a bunch for your help!!

Frank

You can set a timeout statement :smiley: :

with timeout of 3600 seconds
     tell app "Finder" to empty trash
end timeout

Then, after 1 hour, the apple event will time out…
Also (perhaps this is not useful for you this time), you can enclose commands within a ignoring application responses statement:

ignoring application responses
     tell app "Finder" to empty trahs
end ignoring

If you do this, then your script will send the Finder the “empty trash” command and will continue executing statements without waiting for Finder’s response.