How can I use keychain scripting to write a script in Applescript that retrieves the login and password of a website from the login keychain, given the website's URL?
Applescript to retrieve account and password using keychain scripting
applescriptkeychain
Related Question
- Prevent Keychain from copying an internet password to the login keychain
- Replace password prompt with Touch ID to read Keychain password
- Account password in keychain
- IOS – Change password for iCloud keychain / prevent it from being unlocked with computer password
- MacOS – Manually added keychain password not showing on Mac
- How to prompt Safari to save website’s username and password to keychain
- How to move/hover mouse (not click) over a button on Safari by using Applescript
Best Answer
If you know the exact name of the keychain item, you could use the following:
Thing is, Keychain Scripting is slow and quite buggy. For example, searching for a specific keychain item in the example above using
name contains
instead ofname is
does not work. You would have to use a repeat statement similar to what @Philip posted:If you´re okay to use the command line and just want to look up stuff, I´d rather use:
security find-internet-password -g -s www.google.com
and then grep what you want.