Skip to content

Instantly share code, notes, and snippets.

@821760408-sp
Forked from anonymous/gist:5575774
Last active June 23, 2016 06:30
Show Gist options
  • Save 821760408-sp/07761e5707746fc1ad2efe314952754e to your computer and use it in GitHub Desktop.
Save 821760408-sp/07761e5707746fc1ad2efe314952754e to your computer and use it in GitHub Desktop.
Open any link in Safari in Chrome
--
-- open currently active Chrome tab with Safari
-- forked from https://gist.github.com/3151932 and https://gist.github.com/3153606
--
property theURL : ""
tell application "Safari"
set theURL to URL of front document
end tell
if appIsRunning("Google Chrome") then
tell application "Google Chrome"
tell front window
open location theURL
end tell
activate
end tell
else
tell application "Google Chrome"
-- Google Chrome not running, so start it
do shell script "open -a \"Google Chrome\""
tell front window
open location theURL
end tell
activate
end tell
end if
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment