Created
July 8, 2014 17:32
-
-
Save LeEnno/a6f1bded4716bf03f8ab to your computer and use it in GitHub Desktop.
Chromefari – Open Chrome's current tab in Safari or vice versa
This file contains 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
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