Apr 11, '07 07:30:00AM • Contributed by: joeyGibson
#!/bin/bash
if [[ $# == 0 ]]
then
echo "Usage: it "
exit
fi
osascript ~/bin/it.scpt $*
Here's the AppleScript itself, called it.scpt:
on run argv
tell application "iTerm"
activate
tell the first terminal
launch session (item 1 of argv)
end tell
end tell
end run
The shell script makes certain you specified a bookmark to open. Then it calls it.scpt, passing in the session name you asked for. it.scpt will tell iTerm to open the appropriate bookmark in a new tab, which is exactly what I wanted. You can see the code snippets in all their syntax-highlighted glory here if you want, with a bit more info. Note that I have both files living in my ~/bin directory, but you can put them wherever you want, changing the shell script as needed.
