Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kentliau/98604aa5d15061604b6f4fea918268a6 to your computer and use it in GitHub Desktop.
Save kentliau/98604aa5d15061604b6f4fea918268a6 to your computer and use it in GitHub Desktop.
open all chrome tabs of all windows in safari
tell application "Google Chrome"
set window_list to every window
repeat with the_window in window_list
# For each Window in Chrome, create a new Window in Safari respectively
tell application "Safari"
make new document
activate
end tell
set tab_list to every tab in the_window
repeat with the_tab in tab_list
set the_url to the URL of the_tab
tell application "Safari"
set the_new_tab to make new tab at end of tabs of front window
set URL of the_new_tab to the_url
end tell
end repeat
# Close the first tab of Safari, it is the extraneous new window tab
tell application "Safari"
set the_first_tab to the first tab of front window
close the_first_tab
end tell
end repeat
end tell
tell application "Safari"
set window_list to every window whose name is not equal to ""
repeat with the_window in window_list
# For each Window in Safari, create a new Window in Chrome respectively
tell application "Google Chrome"
make new window
activate
end tell
set tab_list to every tab in the_window
repeat with the_tab in tab_list
set the_url to the URL of the_tab
tell application "Google Chrome" to open location the_url
end repeat
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment