Mark Fickett Art: Spawn

This shell script opens a number of new Terminal windows (or tabs) in the current working directory, for MacOS X. Download spawn-2008Sep21.tar.gz or spawn.sh. For example:

$ spawn 4

will open four new Terminal windows, in the same working directory as the first session. Or, as a variation,

$ spawn 4 t

will open four new tabs in the current Terminal window, in the same working directory.

The script uses oascript (AppleScript) to do the actual opening of new windows or tabs. It also creates a ~/.spawn file (which is either empty or contains a cd command) and, when it initially creates ~/.spawn, the script adds a line (to run that file) to ~/.profile.

Installation: my (simplified) setup is that the script resides at ~/code/spawn.sh, and in my shell init (~/.profile) file I have:

alias spawn='~/code/spawn.sh'

which leads to, as above, just being able to type spawn to run the script.

Up for licensing.

2007-10-27 / Shell script, AppleScript / 1 file, 62 lines, 1.3K

In: Code