automatic error handling question

I have an applescript that is automating a program called labview. Once and a while I get error number 1004 which is a labivew application error message. I’m a newbie at scripting. How do i make an error handler that will automatically click ok on error message 1004? Does anyone have an example or know of a book/website which has a clear example of this? Any information about error handling in general would be greatly appreciated. Thanks.


You might be able to use something like this.

tell application "labview"
		-- do something
	on error e number num
		if num is not 1004 then
			display dialog e & return & "Error number: " & num
		end if
	end try
end tell

– Rob