AppleScript UI for timed override code
AppleScript UI for timed override code
- Subject: AppleScript UI for timed override code
- From: "LaMantia, Brian" <email@hidden>
- Date: Fri, 05 Apr 2019 00:49:27 +0000
- Disclaimersource: eop
- Thread-topic: AppleScript UI for timed override code
Hi all. I need a tool that will prompt a user to enter a code, then have that
code passed to shell, and finally the pass/fail response given to the user. I
don’t have much experience with applescript and I am trying to learn. It’s
confussing trying to workflow this going from applescript to sh. Does anyone
have a workflow that will help get me there?
Thank you – Brian
Workflow
1. User given code
2. User executes script
3. User asked for token in UI/ user clicks continue
4. Code is passed as variable to the shell. Something like (do shell script
“cd /Applications/Bit9/Tools; ./b9cli -timedoverride $code”
5. Pass or fail results echoed back to the use in the UI.
CLI command in terminal (example of failure and success)
path = /Applications/Bit9/Tools
mac:Tools user$ ./b9cli -timedoverride <token>
Failed to decode password
mac:Tools user$ ./b9cli -timedoverride <token>
Timed override set
Osascript idea to prompt for code
/usr/bin/osascript <<EOT
set theResponse to display dialog "What's your code?" default answer "" with
icon stop buttons {"Cancel", "Continue"} default button "Continue" with hidden
answer
display dialog "My Secret Code is " & (text returned of theResponse) & "."
EOT
The information contained in this message is proprietary and/or confidential.
If you are not the intended recipient, please: (i) delete the message and all
copies; (ii) do not disclose, distribute or use the message in any manner; and
(iii) notify the sender immediately. In addition, please be aware that any
message addressed to our domain is subject to archiving and review by persons
other than the intended recipient. Thank you.
_______________________________________________
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