Created
April 6, 2019 12:20
-
-
Save mpepping/af304a276fdc9148efb90a4510cceccb to your computer and use it in GitHub Desktop.
AppleScript to copy a Safenet MobilePASS OTP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- AppleScript to copy a Safenet MobilePASS OTP. | |
-- | |
-- 'osascript ~/path/to/token.applescript' | |
-- Set 'passwd' to your MobilePASS passcode. | |
set passwd to "0000" | |
-- Start MobilePASS | |
tell application "MobilePASS" | |
activate | |
delay 1 | |
end tell | |
-- Copy token | |
tell application "System Events" | |
tell table 1 of scroll area 1 of window "MobilePASS" of application process "MobilePASS" | |
delay 1 | |
select row 1 | |
end tell | |
keystroke passwd | |
delay 1 | |
set uiScript to click UI element "Copy Passcode" of window "MobilePASS" of application process "MobilePASS" | |
end tell | |
-- Quit MobilePASS | |
tell application "MobilePASS" | |
quit | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks @mpepping !
I improved this a little further for an even faster approach :-)
takes not even one second now.
(for example by using
set value of text field to passwd
instead ofkeystroke passwd
)