Menu Close

Open Safari Pages in Chrome With a Keystroke

Adobe Flash is a notorious resource and battery hog. I’m currently seeing if I can get by in Safari on my MacBook without it. I had been using an extension to selectively enable Flash in Safari, but I wanted to see if I could live without Flash in Safari entirely, and just jump over to Chrome (which comes packaged with Flash) when I absolutely needed to see a page that used Flash. All of the solutions that I found online involved Applescripts that were throwing errors for me, until I jumped into the Keyboard Maestro Yahoo Group and found a script that worked. I’ve paired that with Keyboard Maestro, and can now use a keystroke to open the currently active Safari tab in Chrome.

I found the working script in message 6596. A user there, Chris Cioffi, offered the following script:

tell application "Safari" to set _url to URL of front document
on error
error "Problem with variable: _url - probably undefined."
end try
do shell script "open -a '/Applications/Google Chrome.app' " & quoted form of _url

That script tried to open Chrome in my Windows virtual machine, and not the Mac app, so I had to tweak it slightly, as seen below. I put the revised script into a Keyboard Maestro macro, as follows (downlink link at the bottom of this article):

Safari to Chrome Keyboard Maestro macro

Now, when I’m in Safari and need to use Flash on a page, I hit CTRL+OPTION+COMMAND+H, and the page that is open in Safari automatically opens in Chrome.

To use the macro, you can download a zip file here. Unzip the file, and then double click on the .kmmacros file within it. That will install the macro into Keyboard Maestro, assuming you own it. You may need to change the keyboard shortcut if it conflicts with a shortcut that you’re already using.