Have you ever opened a web page in Safari and thought to yourself “Dammit, I was supposed to open that in Chrome”?
I do - far often than I’d like to admit!
Still, it’s not a problem for me, as thanks to a quick bit of searching, as well as a great post on the Smile Blog, I can use a TextExpander snippet to run an Apple Script that will take the current tab in Safari and open the contents in Chrome. Pretty handy!
All you need to do is create a new snippet with the settings as per the screenshot below. I’ve also added the code for the AppleScript separately underneath so that you can easily copy and paste whilst creating.
property theURL : "" tell application "Safari" set theURL to URL of current tab of window 1 end tell if appIsRunning("Google Chrome") then tell application "Google Chrome" make new window set URL of active tab of window 0 to theURL activate end tell else tell application "Google Chrome" do shell script "open -a \"Google Chrome\"" set URL of active tab of window 0 to theURL activate end tell end if on appIsRunning(appName) tell application "System Events" to (name of processes) contains appName end appIsRunning
Thanks Smile for this tip. Oh, and for TextExpander as well. It’s still saving me a whole lot of time!