• 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: Keychain Scripting question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keychain Scripting question


  • Subject: Re: Keychain Scripting question
  • From: Deivy Petrescu <email@hidden>
  • Date: Sun, 28 Mar 2010 12:02:02 -0400

On 26/03/2010, at 12:00 , Mason wrote:

> Hey AppleScripters,
>
> I have a script which uses numerous do shell script commands which
> require administrator privileges.
>
> I didn't want to get prompted for a password for this script so I created a
> new keychain item and then call it from the script via the following:
>
> tell application "Keychain Scripting"
> set myScriptKey to first key of current keychain whose name is "scriptKey"
> set pswd to password of myScriptKey
> end tell
>
>
> The above code works for retrieving the proper credentials and I never
> have to enter in my password (which is what I want); however, I am always
> prompted by a pop-up which states:
>
> applet is trying to obtain the password for "scriptKey".
> Keychain wants to use your confidential information stored
> in "scriptKey" in your keychain"
>
> Do you want to allow access to this item?
>
> and then there is an Always Allow button, a Deny button, and an Allow button.
>
> If I choose Always Allow it does not stick and I am still prompted
> again on the next run of the script.
>
> I did go to the keychain item and set access via the
> Access Control tab but regardless of what I do there it still
> does not stick and I still get prompted.
>
> Does anyone know how I can set this once so that it sticks and so that
> I do not get prompted ever again?
>
> BTW, I am running 10.6.2 with all the latest updates.
>
> Thanks in advance for any help!
>
> - Mason Rove

Mason,
you don't need to script Keychain to use the shell scripts.
You can save your password in the script without having it displayed at all.


property psswd:""

use something to ask and encode the password if psswd =""
use the decoder to bring psswd back if psswd is not ""


do shell script "blah"  user name userid password psswd with administrator privileges




Deivy Petrescu
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: 
 >Keychain Scripting question (From: Mason <email@hidden>)

  • Prev by Date: Re: Rep: old script fails AND BUG in Smile 3.5.2 (build 609)
  • Next by Date: Mount With Password
  • Previous by thread: Keychain Scripting question
  • Next by thread: re: Keychain Scripting question
  • Index(es):
    • Date
    • Thread