Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- osascript -e 'tell application id "com.apple.systemevents"'
- -e 'display dialog "Do you want to continue?" & return & return &
- " Please wait..." buttons {"Cancel", "Okay"} default button
- 2 cancel button "Cancel"' -e 'end tell' -e 'if button returned is "Cancel" then'
- -e '<blah blah kill this script>' -e 'end if'
- -- other bash stuff here
- #!/bin/bash
- osascript >/dev/null 2>&1 <<-EOF
- tell application id "com.apple.systemevents"
- set myMsg to "Do you want to continue?" & return & return & " Please wait..."
- set theResp to display dialog myMsg buttons {"Cancel", "Okay"} default button 2
- end tell
- # Following is not really necessary. Cancel returns 1 and OK 0 ...
- if button returned of theResp is "Cancel" then
- return 1
- end if
- EOF
- # Check status of osascript
- if [ "$?" != "0" ] ; then
- echo "User aborted. Exiting..."
- exit 1
- fi
- #-- other bash stuff here
- echo "All good, moving on...."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement