Skip to content

Instantly share code, notes, and snippets.

@vigo
Last active July 19, 2016 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vigo/d31d4c24906fab5ff9a8a3283671aba4 to your computer and use it in GitHub Desktop.
Save vigo/d31d4c24906fab5ff9a8a3283671aba4 to your computer and use it in GitHub Desktop.
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
try
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