-
-
Save 0xBADC0FFEE/19c57eac0b5cb66e0da5ed02e3ada81f to your computer and use it in GitHub Desktop.
Revisions
-
0xBADC0FFEE revised this gist
May 20, 2020 . 2 changed files with 20 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1,13 @@ http://hints.macworld.com/article.php?story=20091013114424722 As a prerequisite, you'll need to install the RCDefaultApp preference pane https://github.com/Lord-Kamina/SwiftDefaultApps Open AppleScript Editor and paste in content of _Script.scpt Save the document using file format Application, and select the Stay Open checkbox. Name it SafariURLHelper. I have an Applications folder in my home directory in which I saved it. Using the Finder, navigate to where you saved SafariURLHelper, then Control-click its icon and select Show Package Contents from the contextual menu. Inside the Contents folder, find Info.plist, and open it in a text editor. Add content of Info.plist to the bottom of the file, just before the closing </dict> and </plist> tags If you had already run the script without this improvement, quit it using "Activity Monitor.app". You can also update the saved Helper app in Script Editor without the need to edit the Info.plist again - our changes are preserved. This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,11 @@ on open location theURL tell application "System Events" if (count of windows of process "Safari") = 0 then tell application "Safari" to make new document tell application "Safari" to set the URL of the front document to theURL else tell application "Safari" to open location theURL end if end tell tell application "Safari" to activate end open location -
mfilej created this gist
Jan 16, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ <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/> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ http://hints.macworld.com/article.php?story=20091013114424722 This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ 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