• 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
Fun with keychain scripting....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fun with keychain scripting....


  • Subject: Fun with keychain scripting....
  • From: David Crowe <email@hidden>
  • Date: Thu, 22 Jan 2004 16:11:42 -0700

I'm trying to write a little utility that will obtain a password from
the keychain. So far I have:

display dialog "Enter name of key or password to view" default answer ""
set KeyName to text returned of the result
tell application "Keychain Scripting"
tell keychain "dad"
repeat with i from 1 to (count keys of it)
if (name of key i) begins with KeyName then
tell me to display dialog "Password="
& (password of key i)
return
end if
end repeat

end tell
end tell
tell me to display dialog "Did not find key <" & KeyName & ">"


Sometimes this work, but other times I get the error:

Can't make +class ppas; of +class ckey; 104 of +script; into a string

Since all the types of key inherit from the basic class "key", how
could there be a password that isn't a string (the dictionary defines
'password' as a string). Is it me? Or AppleScript?


Also, I'd like to eliminate the repeat loop (it's quite slow) but:


password of key whose name is "xyz"

doesn't work (error is "Can't get key whose name = "xyz".).

- David Crowe
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Fun with keychain scripting....
      • From: Gnarlodious <email@hidden>
    • Re: Fun with keychain scripting....
      • From: Gnarlodious <email@hidden>
  • Prev by Date: Re: How the heck do you get records to work?
  • Next by Date: Re: Fun with keychain scripting....
  • Previous by thread: Re: Checking for App running and restart if not
  • Next by thread: Re: Fun with keychain scripting....
  • Index(es):
    • Date
    • Thread