Safari is my default browser, and I have its preferences set to open links from applications in a new tab in the current window. In addition, I use Spaces to segregate my tasks, and I have the 'When switching to an application, switch to a Space with open windows for the application' Spaces' preference unselected.
It is often the case that I have a Safari window open in Space 1 (say), but I've switched to Space 2 to work on another task. I then need to open a URL from an application other than Safari while working on the Space 2 task. If Safari doesn't already have a window open in Space 2, but does have a window in Space 1, Safari opens the URL in a new tab in the window in Space 1. I would rather Safari open a new window in the current Space to handle the URL.
This is doable, but requires a little magic.
As a prerequisite, you'll need to install the RCDefaultApp preference pane.
<key>CFBundleIdentifier</key>
<string>com.apple.AppleScript.SafariURLHelper</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>SafariURLHelper</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>
<string>https</string>
</array>
</dict>
</array>
<key>NSUIElement</key>
<true/>
A little bit of explanation. Most of the above text comes from this tip on macosxautomation.com, and just registers this application as something which can handle http and https links. The NSUIElement addition causes SafariURLHelper to be a background (faceless) application.Mac OS X Hints
http://hints.macworld.com/article.php?story=20091013114424722