• 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: Setting password of a keychain key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting password of a keychain key


  • Subject: Re: Setting password of a keychain key
  • From: "Adam Bell" <email@hidden>
  • Date: Tue, 28 Mar 2006 10:43:33 -0400

I can't answer your direct question, but it will speed up your process of finding a password if you save it as a "generic" key, of which there aren't many, and then get it this way:

to getPassw()
    tell application "Keychain Scripting"
        launch
        tell current keychain to ¬
            tell (some generic key whose name is "ASPW")
                return password
            end tell
    end tell
end getPassw

Otherwise, the whole chain is seached. Your problem may have the same roots - perhaps you have to specify what kind of password it is.

On 3/28/06, Stephen Jonke <email@hidden> wrote:
I am having trouble scripting Keychain Scripting. The following works
fine:

  tell application "Keychain Scripting"
    tell keychain 1
      unlock
      set theKey to (first key whose name is "Some Key")
      set password of (first key of keychain 1 whose name is "HST
VPN") to "SomePassword"
    end tell
  end tell

However, the following does not work:

  tell application "Keychain Scripting"
    tell keychain 1
      unlock
      set theKey to (first key whose name is "Some Key")
      set thePassword to text returned of (display dialog "Enter new
password" default answer "" with hidden answer)
      set password of (first key of keychain 1 whose name is "HST
VPN") to (thePassword as string)
    end tell
  end tell

It gives an error at the "set password" line. I've tried casting the
entered password to "Unicode text", to "International text" and to
"string", as well as not casting. Nothing seems to work. Has anyone
gotten this type of thing to work?

Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Setting password of a keychain key (From: Stephen Jonke <email@hidden>)

  • Prev by Date: Re: Converting Unix path to AppleScript path
  • Next by Date: Re: a script for saving text from the clipboard to a file
  • Previous by thread: Setting password of a keychain key
  • Next by thread: Re: Setting password of a keychain key
  • Index(es):
    • Date
    • Thread