Created
May 18, 2016 11:04
-
-
Save nuada/204e8082280328654ca651f1730a1aa7 to your computer and use it in GitHub Desktop.
Execute command in new Terminal window on Mac OS X using Applescript.
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
#!/bin/sh | |
echo 'on run | |
-- check if Terminal is already running | |
tell application "System Events" | |
set isRunning to (exists process "Terminal") | |
end tell | |
tell application "Terminal" | |
-- if Terminal is running create new window | |
if isRunning then do script "" | |
activate | |
-- some command to execute | |
do script "ls /" in front window | |
end tell | |
end run' | osascript - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment