catch AppleScript error

vettezuki

Registered
My AppleScript is calling a console app with "do shell script." I would like to get the integer return from this console app. According to Apple:

A: All shell commands return an integer status when they finish: zero means success; anything else means failure. If the script exits with a non-zero status, do shell script throws an AppleScript error with the status as the error number. . . .

Great, how do I catch an AppleScript error? Digging, through docs, haven't found answer yet. Please to help.
 
Yep that's the conclusion I came to also, here's what I ended up with:

Code:
try
		do shell script exec
	on error number errNum
		set dumb to 1
		if (errNum is 5) then
			(display dialog "Input file does not appear to be of the correct format.  I f*ng quit.")
		else
			-- If any other error do nothing.
		end if
	end try
	
	
	if (dumb is 0) then
		display dialog "File processed successfully."
	end if


Because I can't directly get integer return of the called appliation, I have to use a dumb variable to handle the nothing bad happened case, or at least so it seems to me now.
 
Back
Top