Skip to content

Instantly share code, notes, and snippets.

@LeEnno
Created July 8, 2014 17:32
Show Gist options
  • Save LeEnno/a6f1bded4716bf03f8ab to your computer and use it in GitHub Desktop.
Save LeEnno/a6f1bded4716bf03f8ab to your computer and use it in GitHub Desktop.
Chromefari – Open Chrome's current tab in Safari or vice versa
tell application "System Events"
set myFrontMost to name of first item of (processes whose frontmost is true)
end tell
property theURL : ""
if myFrontMost is "Google Chrome" then
tell application "Google Chrome"
set theURL to URL of active tab of window 1
end tell
tell application "System Events"
do shell script "Open -a Safari " & theURL
end tell
else if myFrontMost is "Safari" then
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
tell application "System Events"
do shell script "Open -a \"Google Chrome\" " & theURL
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment