Apple - Can you see a list of all open tabs in Safari?

Here is an AppleScript that will get the name of all Tabs in all Safari windows and show them in an unsaved TextEdit document.

You can save this as a plain script and access it from the Script menu on the Menu bar if you enable it in Script Editor's Preferences. Or as an App and it can be placed on the Dock.

tell application "Safari"
    set windowCount to number of windows
    set docText to ""
    repeat with x from 1 to windowCount
        set tabcount to number of tabs in window x
        repeat with y from 1 to tabcount
            set tabName to name of tab y of window x
            set docText to docText & tabName & linefeed as string
        end repeat
    end repeat
end tell
tell application "TextEdit"
    activate
    make new document
    set the text of the front document to docText
end tell

The above source code was modified from Generate a List of Open Safari Tabs with AppleScript.


I don't believe there is a list of tabs available, however, there is a tab overview in Safari if you click

View > Show All Tabs

The keyboard shortcut is Shift+Command+\

Which will show you all of your tabs, grouped by which website they are.

Or if you have pinch-to-zoom support, you can zoom out and it will automatically jump into this view.


A slight modification to [user3439894][1] AppleScript in order to also get the URL of the tab and save that in the resultant text file.

tell application "Safari"
set windowCount to number of windows
set docText to ""
repeat with x from 1 to windowCount
    set tabcount to number of tabs in window x
    repeat with y from 1 to tabcount
        set tabName to name of tab y of window x
        set theURL to URL of tab y of window x
        set docText to docText & tabName & space & theURL & linefeed as string
    end repeat
end repeat
end tell
tell application "TextEdit"
    activate
    make new document
    set the text of the front document to docText
end tell