http://hints.macworld.com/article.php?story=20091013114424722
Created
January 16, 2012 10:13
-
-
Save mfilej/1620117 to your computer and use it in GitHub Desktop.
Make Safari open links from other applications in current space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on open location theURL | |
tell application "System Events" | |
if (count of windows of process "Safari") = 0 then tell application "Safari" to make new document | |
end tell | |
tell application "Safari" to open location theURL | |
end open location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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/> |
Hi @jasondm007, unfortunately I don't know how to achieve that. I also stopped using the script because it was a bit unreliable.
Hi @mfilej - Thanks for getting back to me.
No problem. I'll keep poking around, and let you know if I find a better solution. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mfilej Thanks for sharing! Since the Mac OS X Hints forum is now read-only, I was wondering if you might know how to address one small thing with this script/app: namely, do you know how to force it to only count windows on the user's active desktop/space? More specifically, this is for people that use more than one monitor, who want Safari to open a new window on their active desktop/space even in cases where a Safari window may be open on their inactive desktop/space (by inactive, I mean visible on another monitor/desktop/space, but not the location of the user's active window).
Under this scenario, all monitors will have their own separate space (Mission Control → Displays have separate spaces). Also, if it's not possible to account for one's active space/desktop when counting windows, then the following locations would also work: (1) cursor/mouse or (2) dock.
Thanks for any help you can lend!!