Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Show opened tab count of Safari
tell application "Safari"
set total_tab_count to 0
set number_of_windows to number of windows
repeat with x from 1 to number_of_windows
set current_windows_tab_count to number of tabs in window x
set total_tab_count to total_tab_count + current_windows_tab_count
on error error_message
log error_message
end try
end repeat
display dialog "You have " & total_tab_count & " opened tab(s)"
--number of tabs in window 1
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.