• 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
Tell Me to Quit in Unix-ese...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tell Me to Quit in Unix-ese...


  • Subject: Tell Me to Quit in Unix-ese...
  • From: Oakman <email@hidden>
  • Date: Mon, 06 Apr 2015 16:46:26 -0400

I have a bash script I'm working on where I have a osascript dialog presented to the user via System Events. I want to give the user the opportunity to cancel out of the script, however I know not how to achieve that. Pressing the Cancel button does nothing and I don't know how to pass that 'Cancel' to the bash part of the script. I have googled for three days now w/o any luck. Most links go straight to 'do shell script' and I can't use an applescript as such in this project.

--------------
#!/bin/bash

-- bash stuff here

osascript  -e 'tell application id "com.apple.systemevents"' -e 'display dialog "Do you want to continue?"buttons {"Cancel", "OK"} cancel button "Cancel"  -e 'end tell' -e 'if button returned is "Cancel" then' -e '<kill script>' -e 'end if'

-- I need the code below to not execute

-- other bash stuff here
'
--------------

I welcome and am grateful for any and all comments and help.
 _______________________________________________
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

  • Follow-Ups:
    • Re: Tell Me to Quit in Unix-ese...
      • From: Shane Stanley <email@hidden>
    • Re: Tell Me to Quit in Unix-ese...
      • From: Stan Cleveland <email@hidden>
  • Prev by Date: Re: The Case of the Missing Case Statement
  • Next by Date: Re: Tell Me to Quit in Unix-ese...
  • Previous by thread: Re: passing a list to FMPro from Mail
  • Next by thread: Re: Tell Me to Quit in Unix-ese...
  • Index(es):
    • Date
    • Thread