Can two apps be tied so that when one opens or closes, the other does so?
Save a plist like this as ~/Library/LaunchAgents/test.plist:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;test&lt;/string&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;bash&lt;/string&gt;
    &lt;string&gt;-c&lt;/string&gt;
    &lt;string&gt;while sleep 5; do
  if pgrep -x Preview; then
    pgrep -x TextEdit || open -jga TextEdit
  else
    pgrep -x TextEdit &amp;amp;&amp;amp; osascript -e 'quit app "TextEdit"'
  fi
done&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;
  &lt;key&gt;KeepAlive&lt;/key&gt;
  &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Then load the plist with launchctl load ~/Library/LaunchAgents/test.plist or by logging out and back in.

open -jg is supposed to open an application hidden and without raising any windows. For some document-based applications like TextEdit, it opens a new visible window if the application is open but has no visible windows.

pgrep and the -j option for open were added in 10.8. The -j option is only shown in the help message and not on the man page.