Skip to content

Instantly share code, notes, and snippets.

@martinwinter
Last active November 20, 2020 11:33
Show Gist options
  • Save martinwinter/6336734 to your computer and use it in GitHub Desktop.
Save martinwinter/6336734 to your computer and use it in GitHub Desktop.
Opens all Safari windows and tabs in Google Chrome.
tell application "Safari"
repeat with theSafariWindow in windows
tell application "Google Chrome" to set theChromeWindow to make new window
repeat with theSafariTab in theSafariWindow's tabs
set theURL to URL of theSafariTab
tell application "Google Chrome"
set theChromeTab to make new tab at end of tabs of theChromeWindow
set URL of theChromeTab to theURL
end tell
end repeat
-- Close empty tab created when making new window.
tell application "Google Chrome" to close tab 1 of theChromeWindow
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment