Skip to content

Instantly share code, notes, and snippets.

@ivanski
ivanski / Split Tabs.scpt
Created December 6, 2023 01:32
Split/Copy Safari Tabs
set destWindowIsNew to true
set optionList to {"Copy Tabs", "Move Tabs"}
set tabsAction to choose from list optionList with prompt "What to do with tabs:" default items {"Move Tabs"}
set closeTabs to tabsAction contains "Move Tabs"
tell application "Safari"
set sourceWindow to front window
set sourceTabs to tabs of sourceWindow
set startSourceTabIndex to index of current tab of sourceWindow