Skip to content

Instantly share code, notes, and snippets.

@inouetmhr
Forked from anonymous/gist:5575774
Created May 23, 2014 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inouetmhr/691e28cd4ebe265bbeaa to your computer and use it in GitHub Desktop.
Save inouetmhr/691e28cd4ebe265bbeaa to your computer and use it in GitHub Desktop.
--
-- open currently active Chrome tab with Safari
-- forked from https://gist.github.com/3151932 and https://gist.github.com/3153606
--
property theURL : ""
tell application "Google Chrome"
set theURL to URL of active tab of window 0
end tell
if appIsRunning("Safari") then
tell application "Safari"
tell front window
open location theURL
end tell
activate
end tell
else
tell application "Safari"
-- Safari not running, so start it
do shell script "open -a \"Safari\""
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