MacOS – Assign Application Windows to Different Spaces/Desktops

macosmission-controlspaces

I have two Spaces configured and I keep some Safari windows in one space and some in another. However, Mission Control only allows you to assign an application to a Space, but not different windows within an Application.

As a workaround I created an AppleScript shortcut that executes a new Safari instance:

open -n /Applications/Safari.app

This successfully creates multiple Safari instances, but the instances are still somehow intertwined in Mission Control. When I select an instance from the Dock and choose Options > Assign To > This Desktop or None, that setting in the other instance is updated to be the same.

Is there any way to launch multiple instances of an Application that are each assignable to different Spaces? (Running Mountain Lion 10.8.5.)

Best Answer

You might make a copy of Safari's application bundle and change the bundle identifier:

cp -R /Applications/Safari.app /Applications/Safari2.app
defaults write /Applications/Safari2.app/Contents/Info.plist CFBundleIdentifier my.safari2
cp ~/Library/Preferences/com.apple.Safari.plist ~/Library/Preferences/my.safari2.plist

Assignments to spaces are per bundle identifier:

$ defaults read ~/Library/Preferences/com.apple.spaces.plist app-bindings
{
    "my.safari2" = "FC886111-EE78-4844-A5E5-A11BECA713CF";
}

In this case, you might also use Webkit.app or create a site-specific browser with Fluid.