Created
June 17, 2012 11:21
-
-
Save leighmcculloch/2944239 to your computer and use it in GitHub Desktop.
Auto-Type
This file contains 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
# Author: Leigh McCulloch | |
# License: BSL-1.0 (http://www.opensource.org/licenses/BSL-1.0) | |
# | |
# This script takes arguments from the command line and autotypes | |
# them with tab separators into the last selected application. | |
# This can be used from one application to auto-type into another | |
# application. | |
# | |
# Command line usage: | |
# osascript autotype.spct [username] [password] | |
# | |
# Usage in Cocoa application: | |
# See http://stackoverflow.com/questions/4909702/run-applescript-from-cocoa-application | |
on run argv | |
tell application "System Events" | |
keystroke tab using (command down) | |
delay 0.5 | |
repeat with arg in argv | |
keystroke arg | |
keystroke tab | |
end repeat | |
key code return | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment