Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Copy RSA Token Script for Mac (Automator + Applescript)
-- These are two separate Applescripts that can be executed within an automator workflow. Create a new workflow, create two “run applescript” actions, and paste them. This script will copy the RSA token, set your PIN, and paste it. If you don’t want the pin copied, remove the two lines with “pin” in the second applescript. There are instructions online about setting workflows as services which can be called via key commands.
-- You can set the “terminalapp” to whichever app you use (I use iTerm) and the “pin” to your PIN.
on run {input, parameters}
set terminalapp to "iTerm"
set pin to "6666"
tell application "SecurID"
tell application "System Events"
keystroke "c" using {command down}
end tell
end tell
tell application terminalapp
tell application "System Events"
keystroke pin
keystroke "v" using {command down}
keystroke return
end tell
end tell
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment