Skip to content

Instantly share code, notes, and snippets.

@ianbattersby
Created November 14, 2013 22:14
Show Gist options
  • Save ianbattersby/7475232 to your computer and use it in GitHub Desktop.
Save ianbattersby/7475232 to your computer and use it in GitHub Desktop.
Alfred: Bind hotkey to iterm2 new window
on alfred_script(q)
if isAppRunning("iTerm") then
tell application "iTerm"
set myterm to (make new terminal)
tell myterm
set mysession to (make new session at the end of sessions)
tell mysession
exec command "/bin/zsh -l"
end tell
end tell
activate
end tell
else
activate application "iTerm"
end if
end alfred_script
on isAppRunning(appName)
tell application "System Events" to (name of processes) contains appName
end isAppRunning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment