iTerm2 does allow to set a keyboard shortcut to create a tab with a specific profile. However, I never remember the key combination for this. Instead, I decided to add an extension in Alfred that will do the same thing.
The code for the extension is as follows:
on alfred_script(q) tell application "iTerm" activate set myterm to (current terminal) tell myterm set mysession to (launch session "server") tell mysession set name to q set myVar to "ssh " & q write text myVar end tell end tell end tell end alfred_script
I have the extension triggered on keyword
rt. This allows Alfred commands such as
rt server_name. Where the
server_name is an alias in my SSH config. This will create a new tab using the
server profile and ssh to the server.
The following links were extremely helpful during the creation of the extension.