Very new with apple scripting, I need your help to learn apple scripting and automate some task :
My goal is to auto login into some account webpage and download some documents.
With the help of IA, I understood the base of the code :
tell application "Safari"
activate
open location "https://www.your-website.com"
end tell
tell application "Safari"
activate
delay 2 -- wait
tell front document
do JavaScript "document.getElementById('user-id').value='your-id';"
do JavaScript "document.getElementById('password').value='your-password';"
do JavaScript "document.forms[0].submit();"
end tell
end tell
My question : Is there a way to use the MacOS password application of safari autofill, in order not to write my password into the script ?
MacOS version Sequoia,
Thanks for any help
I’m not aware on how to access Safari passwords from AppleScript, HOWEVER: you can access passwords stored in Keychain. Open Keychain Access.app and manually add new password item.
Is there a way to use the MacOS password application of safari autofill, in order not to write my password into the script ?
I’ve done something like this with 1Password 6, when the UI is still using a native macOS app. Passwords app is inspectable, so it looks to be doable. You will need to prompt the user to unlock via password or touch ID first though. I accomplished that with a recognizable chime and then go on a loop to wait for the user to unlock.
As mentioned, using keystrokes works too when the iCloud keychain sheet is present.