URL Show: Script errors out with no explanation

I have a script saved as an application that shows a URL in Safari for few moments, then switches to a new URL for a display on a Kiosk run by a Mac Mini.
Can someone glance over this simple script and tell me if you see something wrong with it that would make it error out with giving me a reason…

repeat
	try
		my showSites()
	on error e number n
		display dialog "Error number " & (n as string) & " occured " & return & quote & e & quote
	end try
end repeat


on showSites()
	set theSites to {"http://www.macscripter.net", "http://www.apple.com", "http://www.digg.com"}
	repeat with theURL in theSites
		tell application "Safari"
			activate
			set URL of document 1 to theURL
		end tell
		
		delay 12
	end repeat
end showSites

Thanks for any help you may offer,
slimjim5811

Hi slimjim5811,

I just ran your script for 5 min and it did not error out.
I am running Leopard on a PwrMacG5.

Have you tried it on another machine to see if you get
the same results?

Regards,

Craig

The thing is, is that there’s no set time for when it times out. Sometimes 30 minutes, sometimes a few hours. I just checked and this last time it was about 3 hours. All it says is AppleEvent timed out. Shouldn’t the “on error” give me move details about what’s going on?

You may want to put the set URL statement in a “try” block with the display dialog
showing you the error message.


on showSites()
	set theSites to {"http://www.macscripter.net", "http://www.apple.com", "http://www.digg.com"}
	repeat with theURL in theSites
		tell application "Safari"
			activate
			try
				set URL of document 1 to theURL
			on error errMsg
				--remove next line once you discover the issue
				--but leave in the try block
				display dialog errMsg
			end try
		end tell
		
		delay 12
	end repeat
end showSites

Hope this helps!

I’ll give it a try, Craig. Thanks