Skip to content

Instantly share code, notes, and snippets.

@timarnold
Created July 20, 2012 17:08
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save timarnold/3151932 to your computer and use it in GitHub Desktop.
Save timarnold/3151932 to your computer and use it in GitHub Desktop.
TextExpander Snippet (using AppleScript) to open the currently visible page in Safari in Chrome
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
@prenagha
Copy link

slightly tweaked to open in new tab rather than new window
and added comment to use it as a launchbar action
https://gist.github.com/3153606

@timarnold
Copy link
Author

Great addition, prenagha!

@John07
Copy link

John07 commented Dec 28, 2012

If anyone is looking for a way to do exactly the opposite (open currently active Chrome tab with Safari), here's an adapted version of the script to do that: https://gist.github.com/4401082

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment