• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: using a shell variable in an osascript line?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using a shell variable in an osascript line?


  • Subject: Re: using a shell variable in an osascript line?
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 27 Feb 2009 11:28:19 -0500

On Fri, Feb 27, 2009 at 11:08 AM, Axel Luttgens <email@hidden> wrote:
How do I get the result 'button returned:OK' back or the Cancelled value?

Just check the return code of the osascript command: 0 if the user clicks "OK", 1 if the user has canceled.

if osascript -e ' tell application "Finder" to display dialog "OK?" ' >/dev/null 2>&1; then
    # user clicked OK
else
   # user clicked Cancel or something else went wrong
fi

--
Mark J. Reed <email@hidden>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >using a shell variable in an osascript line? (From: LuKreme <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: Axel Luttgens <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: "Mark J. Reed" <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: "Mark J. Reed" <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: René v Amerongen <email@hidden>)
 >Re: using a shell variable in an osascript line? (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: using a shell variable in an osascript line?
  • Next by Date: Rép: Scripts or example scripts for Pages?
  • Previous by thread: Re: using a shell variable in an osascript line?
  • Next by thread: Re: using a shell variable in an osascript line?
  • Index(es):
    • Date
    • Thread