Skip to content

Instantly share code, notes, and snippets.

@GeekAndDad
Created May 24, 2022 03:48
Show Gist options
  • Save GeekAndDad/241122c88ddda834ef0f6d53a10226d0 to your computer and use it in GitHub Desktop.
Save GeekAndDad/241122c88ddda834ef0f6d53a10226d0 to your computer and use it in GitHub Desktop.
*how* many tabs do I have open in Safari? (macOS)
local countOfWindows
local countOfTabs
tell application "Safari"
set countOfWindows to count of windows
set countOfTabs to 0
repeat with n from 1 to countOfWindows
set countOfTabs to countOfTabs + (count of tabs in window n)
end repeat
end tell
display dialog "Safari has " & ((countOfTabs as string) & " tabs open in " & countOfWindows as string) & " windows"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment