(* You need to adjust these three variables to match your bank's login form. You might need a little HTML knowledge to find these. Look for the
tag and tags. You're looking for the name= attribute. This is what you put in the variables. *) set theFormName to "login" set theUserNameInputName to "username" set thePasswordInputName to "password" tell application "Keychain Scripting" (* Set the next line to match the name of the keychain you created *) set myChain to keychain "ApplescriptKeys.keychain" set theKeyUserID to the account of key 1 of myChain set theKeyPassword to the password of key 1 of myChain end tell tell application "Safari" activate do JavaScript "document.forms['" & theFormName & "']['" & theUserNameInputName & "']['value']='" & theKeyUserID & "'" in document 1 do JavaScript "document.forms['" & theFormName & "']['" & thePasswordInputName & "']['value']='" & theKeyPassword & "'" in document 1 end tell (* Comment out or delete this part if you don't have UI Scripting enabled or you would rather press return yourself *) tell application "System Events" tell process "Safari" keystroke return end tell end tell