Supressing error alerts

My build keeps generating weird error messages for nothing. It (occasionally) chokes on simple tasks like -

tell window 1
	set alpha value to 0.0
	repeat 10 times
		set alpha value to (alpha value + 0.1)
		delay 0.1
	end repeat
end tell

  • giving me “Applescript error -1762” (apparently the delay is the culprit, how silly!). The script works just fine when run externally, so I know the error is not in the code itself. Cleaning the build doesn’t help.

However, the errors don’t prevent my app from working, the script keeps running without problems. So, if I can’t fix what isn’t broken, I figured a solution would be to disable the error alerts, but I can’t find anything in the docs on how to do this. Is it even possible?

You can try putting that inside a try block.

try
	tell window 1
		set alpha value to 0.0
		repeat 10 times
			set alpha value to (alpha value + 0.1)
			delay 0.1
		end repeat
	end tell
end try

Try blocks don’t help. The error alerts are displayed in any case. But even if they did, it wouldn’t be a good solution since the repeat loop would never be completed, leaving me with an invisible window…

I think this is a known error introduced in OS 10.4.blah? Try this:

10.4.3 Breakage

Thanks jj, you were right. It is such a silly bug. And that it is still present in 10.4.4 should be most embarrassing for Apple.