Jump to content
Sign in to follow this  
cee9

do shell script not picking up errors

Recommended Posts

Hi All,

I'm new here so please be gentle....

This works for me in the script editor (its part of a longer script)

try

set appnames to do shell script "/hosts/bern/user_data/HR/jobsappv1 -g -i=5"

on error the error_message

display dialog "Error encountered"

return

end try

If the script "jopsappv1" returns an error (exits with 1) then the script does the "on error" bit.

If I run it in filemaker as a "perform applescript" I can't get it to do the "on error" bit when it encounters an error. I even tried giving it the name of a script that does not exist and it still does not do the "on error" bit.

I'm using the "Native applescript" option.

Any pointers very greatfully appreciated.

Chris

Share this post


Link to post
Share on other sites

I seem to have found an workaround for my problems.

If I wrap my filemaker "Native AppleScript" with a "tell application" and point it at the Applescript utility like this

tell application "osascript"

try

do shell script .....

on error errStr

display ...

end try

end tell

the error handling seems to work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.