Jump to content
Server Maintenance This Week. ×

do shell script not picking up errors


This topic is 5454 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

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

Link to comment
Share on other sites

  • Newbies

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.

Link to comment
Share on other sites

This topic is 5454 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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