Created
June 1, 2016 19:25
-
-
Save hanneskaeufler/4b94e292372639fde003729726500669 to your computer and use it in GitHub Desktop.
AppleScript to move all the open tabs in Google Chrome to Safari
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 "Google Chrome" | |
set allUrls to {} | |
repeat with theWindow in every window | |
set urlsInWindow to {} | |
repeat with theTab in every tab of theWindow | |
set currentUrl to the theTab's URL | |
set urlsInWindow to urlsInWindow & {currentUrl} | |
end repeat | |
set allUrls to allUrls & {urlsInWindow} | |
end repeat | |
end tell | |
tell application "Safari" | |
repeat with aWindow in every list of allUrls | |
make new document | |
activate | |
repeat with aUrl in every string of aWindow | |
open location aUrl | |
end repeat | |
end repeat | |
end tell | |
tell application "Google Chrome" to quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment