Skip to content

Instantly share code, notes, and snippets.

@alloydwhitlock
Last active June 11, 2017 01:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alloydwhitlock/9216519 to your computer and use it in GitHub Desktop.
Save alloydwhitlock/9216519 to your computer and use it in GitHub Desktop.
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"
activate
tell application "System Events"
keystroke "c" using {command down}
end tell
end tell
tell application terminalapp
activate
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