• 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: EXTERNAL: Re: AppleScript UI for timed override code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXTERNAL: Re: AppleScript UI for timed override code


  • Subject: Re: EXTERNAL: Re: AppleScript UI for timed override code
  • From: "LaMantia, Brian" <email@hidden>
  • Date: Fri, 05 Apr 2019 14:51:09 +0000
  • Disclaimersource: eop
  • Thread-topic: EXTERNAL: Re: AppleScript UI for timed override code

Thank you Naganoya. I can see I’m going to like applescript.  Now any ideas on
how to get the textResponse variable passed to the CLI in terminal?

I added the do shell script and it doesn’t fail but I don’t know if it failed.
Maybe an echo?  And can a variable be passed the way I have it in the image?

Thank you



set theResponse to display dialog "Enter code: " default answer "" with icon
stop buttons {"Cancel", "Continue"} default button "Continue" with hidden answer



set code to button returned of the theResponse

if code = "Cancel" then return ""



set textResponse to (text returned of theResponse)



display dialog ("Code is: " & textResponse & ".") buttons {"OK"} default button
1

return textResponse



do shell script "cd /Applications/Bit9/Tools; ./b9cli -timedoverride
textResponse"


Brian LaMantia


From: Takaaki Naganoya <email@hidden>
Date: Friday, April 5, 2019 at 2:07 AM
To: Applescript Users List <email@hidden>
Cc: "LaMantia, Brian" <email@hidden>
Subject: EXTERNAL: Re: AppleScript UI for timed override code

Hi,

Your code dose not return actual result (User given code or canceled status).
You’d better to execute AppleScript code with Script Editor
(/Applications/Utilities/Script Editor.app).
Then the return data will be obvious.

[cid:7B148C74-C945-478E-9ACD-5DEC31B8A6DD]


2019/04/05 9:49、LaMantia, Brian
<email@hidden<mailto:email@hidden>>のメール:

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
• User given code
• User executes script
• User asked for token in UI/ user clicks continue
• Code is passed as variable to the shell. Something like (do shell script “cd
/Applications/Bit9/Tools; ./b9cli -timedoverride $code”
• 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<mailto:email@hidden>)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

--
Takaaki Naganoya
email@hidden<mailto:email@hidden>
http://piyocast.com/as/



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.

JPEG image

 _______________________________________________
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: EXTERNAL: Re: AppleScript UI for timed override code
      • From: Takaaki Naganoya <email@hidden>
References: 
 >AppleScript UI for timed override code (From: "LaMantia, Brian" <email@hidden>)
 >Re: AppleScript UI for timed override code (From: Takaaki Naganoya <email@hidden>)

  • Prev by Date: Re: AppleScript UI for timed override code
  • Next by Date: Re: EXTERNAL: Re: AppleScript UI for timed override code
  • Previous by thread: Re: AppleScript UI for timed override code
  • Next by thread: Re: EXTERNAL: Re: AppleScript UI for timed override code
  • Index(es):
    • Date
    • Thread