Skip to content

Instantly share code, notes, and snippets.

@rretsiem
Forked from timarnold/gist:3151932
Last active December 11, 2015 13:09
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 rretsiem/4605557 to your computer and use it in GitHub Desktop.
Save rretsiem/4605557 to your computer and use it in GitHub Desktop.
open currently open URL in Safari in Chrome - modified to use no "do shell" works in Applescript as well
--
-- open currently open URL in Safari in Chrome
--
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
tell application "Google Chrome" to activate
tell application "Google Chrome"
if (count of (every window where visible is true)) is greater than 0 then
-- running with a visible window, ready for new tab
else
-- running but no visible window, so create one
make new window
end if
tell front window
make new tab with properties {URL:theURL}
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment