Created
February 21, 2016 07:48
-
-
Save krid78/efc58dd5a9907cf06da6 to your computer and use it in GitHub Desktop.
Alfred iTerm2 (version 2) for '>'
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
-- http://www.alfredforum.com/topic/721-executing-iterm2-terminal-commands-in-current-shell/ | |
on alfred_script(q) | |
tell application "iTerm" | |
activate | |
try -- We don't need error messages | |
set miniaturized of windows to false | |
end try | |
try | |
set _session to current session of current terminal | |
on error | |
set _term to (make new terminal) | |
tell _term | |
launch session "Default" | |
set _session to current session | |
end tell | |
end try | |
tell _session | |
write text q | |
end tell | |
end tell | |
tell application "System Events" | |
set visible of process "iTerm" to true | |
end tell | |
end alfred_script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment