13

I have certain applications set to open in certain spaces, but would like them to open in the background and not switch the space just so I can watch them open.

Hennes
  • 65,804
  • 7
  • 115
  • 169
Philip
  • 1,273

3 Answers3

10

There is also the '-g' option to 'open' that will run programs in the 'background' in that they won't steal focus away from the current app. Try

open -g /Applications/iCal.app

for instance. See here for details:

If you want to edit the Info.plist of some application to make this permanent, you can add the key

<key>LSBackgroundOnly</key>
<true/>

See here for details.

kenorb
  • 26,615
3

This will prevent any autoswitching of Spaces, which meets your criteria, but does other things, too, that you may not want:

defaults write com.apple.dock workspaces-auto-swoosh -bool false
osascript -e 'tell application "Dock" to quit'
wfaulk
  • 6,307
1

(above user refused to let me cite the official documentation in my edits to his answer, so I'm adding it for the benefit of actual users who want to get the authoritative source of truth)

From man open

      -g  Do not bring the application to the foreground.

Example:

open -g -a /Applications/TextWrangler.app /path/to/myFile.txt