Delay command locking up interface

So I was reading in another thread here http://bbs.applescript.net/viewtopic.php?pid=47979 that as of 10.4.5 delay was seemingly broken… is this still the case? Because I can’t get it to work.

What I’m trying to do is star my app with a spalsh screen that has a check box to disable seeing the app in the future, but you can’t check the box admist the delay. The delay beeing 10 seconds after that time the splash screen should go away on its own.


on launched theObject
	sCheckSplash()
end

on sCheckSplash()
	tell window "win_Splash"
		if (integer value of button "Btn_SplashStop") = 0 then
			center
			set visible to true
		end if
	end tell
	run script "delay 10"
	tell window "win_Splash" to set visible to false
end sCheckSplash

So thats pretty much what I’m working with at the moment. Any ideas? I was going to try knaster’s suggestion in that old thread, but don’t know where to put his ‘methods’ code.

Thanks in advance.

I’ve worked around a similar problem by ‘creating’ a delay by repeating an arbitrary command, such as update. The script updates a window (probably millions of times) but in doing so, takes up 10 seconds. Something like this:


set myDate to (time of (current date) as number) + 10 -- here we set a finish time
repeat while ((time of (current date)) is less than myDate) -- keep doing the arbitrary action until we reach the finish time
	tell window "main" to update
end repeat

-- hide your splash screen here....
   tell window "win_Splash" to set visible to false