A sort of follow-up to ‘Fixed it’ – Minor adjustments to the script I propably use the most. I now use iTerm2.app.
The script provides me with the following features:
#gives me a list of terminal profiles
% it list
#open a new iTerm session with the specified profile
% it <profile>- #!/bin/bash
- #http://mkaz.com/ref/macosx/iterm.html
- #http://www.macosxhints.com/article.php?story=20070409141256538
- arg=$1;
- if [[ “$#” = “0” ]]; then
- echo “Usage: ‘it bookmarkname’ or ‘it list’” && exit 1
- elif [[ “$1” = “list” ]]; then
- defaults read ~/Library/Preferences/com.googlecode.iterm2|grep -e ‘\bName =‘|awk ‘{$1=“”;$2=“”; print $0}’|tr -d ‘;’
- else
- osascript <<ENDSCRIPT
- on run argv
- tell application “iTerm”
- activate
- tell the current terminal
- launch session “$1”
- end tell
- end tell
- end run
- ENDSCRIPT
- fi
I wonder if it should default to the default profile, so no arguments would just open a default terminal?



0 Comments.