Last active
June 18, 2017 13:43
-
-
Save 1syo/5c50bd3b768102027dc98901ced56e49 to your computer and use it in GitHub Desktop.
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 alfred_script(q) | |
tell application "System Events" | |
if not (exists (processes where name is "Terminal")) then | |
tell application "Terminal" | |
activate | |
do script q in first window | |
end tell | |
else | |
tell application "Terminal" | |
activate | |
if (count of windows) is 0 then | |
do script | |
do script q in first window | |
else | |
tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down | |
delay 1 | |
do script q in first window | |
end if | |
end tell | |
end if | |
end tell | |
end alfred_script | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment