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

Setting password of a keychain key


  • Subject: Setting password of a keychain key
  • From: Stephen Jonke <email@hidden>
  • Date: Tue, 28 Mar 2006 08:02:46 -0500

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.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Setting password of a keychain key
      • From: kai <email@hidden>
    • Re: Setting password of a keychain key
      • From: "Adam Bell" <email@hidden>
  • Prev by Date: Re: Missing class?
  • Next by Date: Re: Converting Unix path to AppleScript path
  • Previous by thread: Re: Missing class?
  • Next by thread: Re: Setting password of a keychain key
  • Index(es):
    • Date
    • Thread