Show your open browser tab count in your Mac menu bar

Tabs pile up quietly: a few windows in, nobody knows whether it’s 20 or 120. A Script meter asks Safari or Google Chrome with AppleScript how many tabs are open across all its windows and puts the number next to the clock, so you see it climb.

It only asks while the browser is open. When the browser is closed the meter says “closed” instead of launching it every time it refreshes.

Recipe tested October 29, 2026 with Multimeter 1.1. Source: Script.

Preview: the Label & Value face and two alternatives, with sample values like the ones this recipe returns.

What you need

  • Multimeter for macOS 13 or later, $19.99 once.
  • The direct download version of Multimeter from this site (the Script source isn’t in the Mac App Store version).
  • Multimeter 1.1.1 or later. Earlier versions can’t ask macOS for permission to talk to other apps. Choose Check for Updates… from any meter’s menu.
  • Safari, Google Chrome, or both.

Set it up

  1. Pick the command for your browser. For Safari, this counts the tabs in every Safari window and prints a placeholder when Safari isn’t running:
    Safari
    osascript -e 'if application "Safari" is running then' -e 'tell application "Safari" to return count tabs of windows' -e 'else' -e 'return "{\"value\": 0, \"formatted\": \"closed\"}"' -e 'end if'
  2. For Google Chrome, the same line with Chrome’s name. It counts tabs in every Chrome window, Incognito windows included:
    Google Chrome
    osascript -e 'if application "Google Chrome" is running then' -e 'tell application "Google Chrome" to return count tabs of windows' -e 'else' -e 'return "{\"value\": 0, \"formatted\": \"closed\"}"' -e 'end if'
  3. In Multimeter, choose Add Meter… from any meter’s menu, pick Script and paste the command. Use both commands in two meters if you use both browsers, or the combined command under Variations for one meter.
  4. Set Refresh every to 1 minute, or 30 seconds if you want it to follow you closely. Counting takes the browser well under a second, even with 100 tabs open.
  5. Set the label to SAFARI, CHROME or TABS, the range to 0 to 100, and, if you’d like a nudge to tidy up, alerts to High values with a warning at 30 and critical at 60. Those numbers are only a suggestion; pick the levels where you’d want to close some.
  6. With the browser open, wait for the first refresh. macOS asks once for each browser: “Multimeter” wants access to control “Google Chrome”. Allowing control will provide access to documents and data in “Google Chrome”, and to perform actions within that app. (or the same with “Safari”). Below it is Multimeter’s reason: “Multimeter runs your script meters, and scripts that read other apps (like Things, Reminders, Mail or Music) need your permission to control them.” Click Allow. Until you do, the meter shows a dash; the number appears at the next refresh, or right away with Refresh Now in the meter’s menu.

Multimeter settings

In Customize This Meter… (from the meter’s menu):

Settings for this meter
SettingValue
SourceScript
Commandthe osascript line for your browser
Refresh every1 minute or 30 seconds
Range0 to 100
AlertsHigh values: warning 30, critical 60 (optional)
LabelSAFARI, CHROME or TABS
FaceLabel & Value or LCD Readout
Width120 pt for Label & Value, 130 pt for the combined meter
The Mac menu bar showing SAFARI 24, CHROME 41 in yellow and TABS 24+41 in red

Tested: Set up on October 31, 2026 in Multimeter 1.1.1 on macOS 27 with Safari 27.0 and Google Chrome 156, three Label & Value meters (Safari, Chrome and the combined command) refreshing every 30 seconds, alerts at 30 and 60. macOS asked once for Safari and once for Chrome, each with Multimeter’s reason; after Allow the menu bar showed SAFARI 24, CHROME 41 in yellow and TABS 24+41 in red. With 100 tabs across four windows in each browser, each single-browser command took 0.4 to 1 second when run in Terminal, and the combined command counted all 200 in 0.5 to 0.7 seconds, far inside the 10 second limit. Chrome’s “Allow JavaScript from Apple Events” stayed off; counting tabs doesn’t need it. With Chrome quit the meters showed CHROME closed and TABS 24+0; with Safari open but no windows, SAFARI 0; with both quit, closed on all three, and neither browser was relaunched by later refreshes.

Script meters need the direct download version of Multimeter from this site, which is the one on sale now. How commands run, the PATH they see and the 10 second limit are in the Script meters guide.

Limits

  • The browser must be open. That’s on purpose: asking a closed browser would launch it.
  • Safari and Google Chrome only. Other browsers have different AppleScript support, or none.
  • Chrome Beta, Dev and Canary are separate apps; replace Google Chrome with the app’s exact name, for example Google Chrome Beta.
  • The combined command names both browsers, so it needs both installed. When we ran it on a Mac without Chrome, macOS asked “Where is Google Chrome?”. If you only have one, use its own command.

Variations

Both browsers in one meter

This adds up Safari and Chrome. It sends JSON: value is the total, which the range and alerts use, and formatted is the text shown, Safari’s count plus Chrome’s, like 24+41. A browser that isn’t running counts as 0, and the meter says “closed” only when both are.

Command
osascript -e 'set s to 0' -e 'set c to 0' -e 'set n to 0' -e 'if application "Safari" is running then' -e 'tell application "Safari" to set s to count tabs of windows' -e 'set n to n + 1' -e 'end if' -e 'if application "Google Chrome" is running then' -e 'tell application "Google Chrome" to set c to count tabs of windows' -e 'set n to n + 1' -e 'end if' -e 'if n is 0 then return "{\"value\": 0, \"formatted\": \"closed\"}"' -e 'return "{\"value\": " & (s + c) & ", \"formatted\": \"" & s & "+" & c & "\"}"'

Count windows instead

Replace count tabs of windows with count windows.

Troubleshooting

What the meter says, why, and what to do
SymptomCauseFix
The meter says closedThe browser isn’t running. The command skips it when it’s closed so it never launches it.Open the browser. The number shows at the next refresh.
The meter shows 0 with the browser openThe browser is running with no windows open, so there are no tabs to count.Nothing to fix: open a window and the number comes back at the next refresh.
The meter shows a dash while Safari or Google Chrome is openMultimeter isn’t allowed to control Safari or Google Chrome: you clicked Don’t Allow, or the question is still waiting on screen (the script stops after 10 seconds while it waits).Answer the prompt if it’s open. If you turned it down, open System Settings, Privacy & Security, Automation, click the arrow next to Multimeter and turn on Safari or Google Chrome. The next refresh shows the number.
Works in Terminal, nothing in the meterTerminal and Multimeter each need their own permission. Allowing Terminal to control Safari or Google Chrome doesn’t allow Multimeter.Look for Multimeter, not Terminal, under System Settings, Privacy & Security, Automation, and turn on Safari or Google Chrome there.
The script didn’t print a numberThe command failed or printed an error message instead.Run the exact command in Terminal. If it works there, check for tools that live outside the meter’s PATH and use their full path (which tool).
The script took longer than 10 secondsA slow network call. Multimeter stops scripts after 10 seconds.Keep the -m timeout on curl, and refresh less often.
Scripts need the version from multimeterapp.comThis copy of Multimeter came from the Mac App Store, which can’t run scripts.Use the direct download version, or run the command from cron or launchd and point a File meter at its output.

Questions

Does this work in the Mac App Store version?

Script meters need the direct download version from multimeterapp.com, because the App Store sandbox doesn’t let apps run your commands. Web Address, File and Sent Value meters work in every version.

Does Multimeter see which sites I have open?

No. The command asks the browser for one number, how many tabs it has, and nothing else. macOS’s prompt describes the permission in general terms (“access to documents and data”) because it covers any script you might write; the ones on this page read only the count.

Do I need to turn on “Allow JavaScript from Apple Events” in Chrome?

No. That setting lets scripts run JavaScript inside pages. Counting tabs doesn’t touch pages, and in our test it worked with the setting off, which is Chrome’s default.

Will lots of tabs slow my Mac down?

It depends on what they’re doing. A busy tab uses the processor, and Chrome’s Task manager names it (Why is Google Chrome Helper using so much CPU?); open tabs also take memory (Why is my Mac so slow?). This meter counts tabs. It doesn’t measure how much they use.

Related

Put it in your menu bar

$19.99 one-time. No subscription. Needs macOS 13 Ventura or later.