-
-
Save 821760408-sp/07761e5707746fc1ad2efe314952754e to your computer and use it in GitHub Desktop.
Open any link in Safari in Chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- 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