Created
August 11, 2012 08:00
-
-
Save geeksunny/3322352 to your computer and use it in GitHub Desktop.
An AppleScript file to open a new tab in Terminal.app and immediately execute a given command.
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
on run argv | |
if (count argv) is not equal to 0 then | |
tell application "Terminal" | |
activate | |
tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down | |
do script item 1 of argv in front window | |
end tell | |
#else | |
# display alert "Oops!" message "You didn't pass any parameters to this script!" as critical | |
end if | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The 'display alert' line will only work if the script is compiled into a .app