Execute command on launch of custom Terminal Window in OSX10.5+ I'm trying to find a way to automatically launch a command when Terminal is run, but:


Have the Terminal window close after command has returned control to it / after (using &amp;) after command has started launching.
Not have the user change any settings themselves / not have the settings changed globally.


I have found (mainly from a relatively very comprehensive write-up on http://docstore.mik.ua/orelly/unix3/mac/ch01_03.htm) the ability to create a .terminal file and edit the contents (plist) to contain xml like the below.

    &lt;key&gt;ExecutionString&lt;/key&gt;
    &lt;string&gt;ssh xyzzy.oreilly.com; exit&lt;/string&gt;


However:


Given the date of other postings (on google) showing this functionality
The fact that the procedure which I eventually found to create custom Terminal windows, was subtly different from the instructions in the article above
The fact that (at least with OSX10.5) they are now .term files (and complain that the file is not executable if changed to .terminal)


... am guessing that some version of OSX, post all the information I can find on this technique, changed this functionality. Is this correct in any version of OSX 10.5+?

Also, is there still a way to launch a command automatically in a custom terminal window (or similar, that isn't AppleScript / Automater / etc)?
ExecutionString was changed to CommandString
Use it in the same way. When you do a Shell > Export Settings… it outputs a .terminal file. In my file it is located immediately after 

&lt;key&gt;BackgroundSettingsForInactiveWindows&lt;/key&gt;
&lt;true/&gt;
&lt;key&gt;CommandString&lt;/key&gt;
&lt;string&gt;/blah/blah/blah/blah.sh run&lt;/string&gt;


(MountainLion 10.8.5)

So then you would run the following command from terminal or a script…

open ~/Documents/blah.terminal