how can I add a timed delay in a script?


the problem is the following:
My G5 boots every morning at the same time, when I’m there or not…
automatically it launches Entourage with no probs… but I have another application that launches too wich needs internet connection, but since my airport launches later than this program I see the: ‘was unable to connect to the internet’ box instead of this app running… so I would like to make an applescript launcher wich gives this program a certain delay before it starts so I can be sure Airport is available when it starts.




In the System preferences, I think you can drag your app to the place in the order of apps launched. Still, the Internet connection may not be available when it is your apps’ turn. It’s been a while since I scripted Internet connections but I think it can be done. If the order doesn’t do it then, maybe somebody with dial up can find a property that tells you if you have a connection.


Instead of adding your app “X” to the login items, you can add an applescript-app with a code similar to this UNTESTED one:

		do shell script "curl [url=]"[/url]
		exit repeat --> success!
	end try
	delay 10 --> wait 10 seconds before the next try
end repeat

launch application "X"