Created
February 14, 2014 06:04
-
-
Save cbess/8996488 to your computer and use it in GitHub Desktop.
Command line access with AppleScript
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
| -- open Terminal and do stuff | |
| tell application "Terminal" | |
| set currentTab to do script ("python") | |
| delay 1 | |
| do script ("import sys") in currentTab | |
| do script ("sys.path") in currentTab | |
| delay 1 | |
| --close front window | |
| end tell | |
| -- send a keyboard shortcut/cmd to Terminal | |
| activate application "Terminal" | |
| tell application "System Events" | |
| keystroke "d" using control down | |
| end tell |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
keychain access - http://stackoverflow.com/questions/10574381/how-to-use-a-password-from-the-keychain-within-an-applescript-running-within-mai
keyboard use/codes - http://apple.stackexchange.com/questions/94269/applescript-code-to-simulate-command-and-shift-keys
terminal script ex:
http://macscripter.net/viewtopic.php?id=15013
http://stackoverflow.com/questions/1870270/sending-commands-and-strings-to-terminal-app-with-applescript