Skip to content

Instantly share code, notes, and snippets.

@autonome
Last active July 8, 2016 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autonome/c6d26250125047963f322f837a7aefa2 to your computer and use it in GitHub Desktop.
Save autonome/c6d26250125047963f322f837a7aefa2 to your computer and use it in GitHub Desktop.
Applescript to open Chrome active tab in Firefox and Safari
(*
To install:
1. Open Script Editor
2. Copy the code below into the editor
3. File > Save > Choose type "application"
4. Give a name you'll remember like "openChromeURLInFirefox"
5. Save to your Applications directory (so it can be indexed by Spotlight)
To use:
Open Spotlight and type the name you gave the application. The active tab of Chrome will close
and a new tab will open in Firefox with the same URL.
Thanks to original pointer at http://softwarerecs.stackexchange.com/questions/14002/is-there-a-open-in-firefox-google-chrome-extension.
Changes I made:
* Close Chrome tab
* Make Firefox active window after loading tab
* Open in Safari
*)
tell application "Google Chrome Canary"
set urlChrome to get URL of active tab of first window
-- Delete the line below if you want to keep the tab open in both browser
delete tab (active tab index of window 1) of window 1
end tell
tell application "FirefoxNightly"
open location urlChrome
activate
end tell
tell application "Safari"
open location urlChrome
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment