Created
March 14, 2011 16:52
-
-
Save gfontenot/869440 to your computer and use it in GitHub Desktop.
Open the current Safari page in Google Chrome
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 "Safari" | |
set the_url to URL of front document | |
end tell | |
tell application "Google Chrome" | |
try | |
set win to first window | |
on error | |
set win to make new window | |
end try | |
tell win | |
set test_url to URL of active tab | |
if URL of active tab = "chrome://newtab/" then | |
set URL of active tab to the_url | |
else | |
set all_tabs to get tabs of win | |
set found_tab to false | |
repeat with a_tab in all_tabs | |
if URL of a_tab is the_url then | |
set found_tab to true | |
end if | |
end repeat | |
if found_tab is false then | |
set newTab to make new tab with properties {URL:the_url} | |
end if | |
end if | |
end tell | |
activate | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment