DEV Community

Magne
Magne

Posted on

Count number of tabs in Safari

Finder → Go → Utilities → Script Editor:

tell application "Safari"
    count of tabs of front window
end tell
Enter fullscreen mode Exit fullscreen mode

Or:

tell application "Safari"
    count every tab of every window
end tell
Enter fullscreen mode Exit fullscreen mode

Don't worry, if any AppleScript has a bug and doesn't run, then it won't affect Safari. It simply gives an error in the Script Editor.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more