Appleevent timed out - How to solve?

I am new to Applescript. I wrote following script to duplicate folders. In these folders there are more than 100 files (large postscript-files). When I run the script and there are many files in the folders, then I get following message after a few minutes: Appleevent timed out.
How can I solve this problem?? I think that the finder needs more time to duplicate the folders.
I hope that anybody can tell me which instruction and where I must put it in…

Many thanks!


tell application "Finder" 
set jona1 to count every file of folder "1_PS-files Jona" of desktop 
if jona1 > 0 then 
duplicate folder "1_PS-files Jona" of desktop 
move every file in folder "1_PS-files Jona" of desktop to 
folder "Jona:In" of desktop 
open folder "Jona:In" of desktop 
open folder "Jona:Out" of desktop 
end if 
set weblinks1 to count every file of folder "1_PS-files Xtranet met 
weblinks" of desktop 
if weblinks1 > 0 then 
duplicate folder "1_PS-files Xtranet met weblinks" of desktop 
move every file in folder "1_PS-files Xtranet met weblinks" of 
desktop to folder "Xtranet met weblinks:In" of desktop 
open folder "Xtranet met weblinks:In" of desktop 
open folder "Xtranet met weblinks:Out" of desktop 
end if 
set xtranet1 to count every file of folder "1_PS-files Xtranet" of 
desktop 
if xtranet1 > 0 then 
duplicate folder "1_PS-files Xtranet" of desktop 
move every file in folder "1_PS-files Xtranet" of desktop to 
folder "Xtranet:In" of desktop 
open folder "Xtranet:In" of desktop 
open folder "Xtranet:Out" of desktop 
end if 
set goekint1 to count every file of folder "1_PS-files Goekint" of 
desktop 
if goekint1 > 0 then 
duplicate folder "1_PS-files Goekint" of desktop 
move every file in folder "1_PS-files Goekint" of desktop to 
folder "Goekint A3 2400:In" of desktop 
open folder "Goekint A3 2400:In" of desktop 
open folder "Goekint A3 2400:Out" of desktop 
end if 
end tell 

Operating System: Mac OS 9.0.x

Hi Jesse,

what you need is the with timeout statement.
I wrapped your code in a repeat block, because you
use four times the same code with different folder names

I haven’t tested this, but it should work

PS: if all the folders are on desktop, you can omit of desktop.
AppleScript takes the desktop as the “top level”

set folderList to {"1_PS-files Jona", "1_PS-files Xtranet met weblinks", "1_PS-files Xtranet", "1_PS-files Goekint"}
set InList to {"Jona:In", "Xtranet met weblinks:In", "Xtranet:In", "Goekint A3 2400:In"}
set OutList to {"Jona:Out", "Xtranet met weblinks:Out", "Xtranet:Out", "Goekint A3 2400:Out"}

tell application "Finder"
	repeat with i from 1 to count folderList
		if (count files of folder (item i of folderList)) > 0 then
			with timeout of 10000 seconds
				duplicate folder (item i of folderList)
				move every file in folder (item i of folderList) to folder (item i of InList)
			end timeout
			open folder (item i of InList)
			open folder (item i of OutList)
		end if
	end repeat
end tell

Many thanks! It works fine! I had an error that a specific folder: Jona:IN was not founded.

I changed your suggestion into:


set InList to {"[b]Macintosh HD:Desktop folder:[/b]Jona:In", "[b]Macintosh HD:Desktop folder:[/b]Xtranet met weblinks:In", "[b]Macintosh HD:Desktop folder:[/b]Xtranet:In", "[b]Macintosh HD:Desktop folder:[/b]Goekint A3 2400:In"}
set OutList to {"[b]Macintosh HD:Desktop folder:[/b]Jona:Out", "[b]Macintosh HD:Desktop folder:[/b]Xtranet met weblinks:Out", "[b]Macintosh HD:Desktop folder:[/b]Xtranet:Out", "[b]Macintosh HD:Desktop folder:[/b]Goekint A3 2400:Out"}

I think that the error comes because IN was a subfolder of the other folders. When a map is not a subfolder of a folder at the desktop, then you could use the name on the desktop folder.

Kindly regards

oh, sorry, I didn’t realize that.

If the folder is a subfolder, then you must write e.g. folder “Jona:Out” of desktop.

btw: you can directly duplicate the files into the destination folder

duplicate every file in folder (item i of folderList) to folder (item i of InList) of desktop

I’m guessing that this is an OS X topic rather than an OS 9.2.2, so I’ve moved it there.