Last active
July 19, 2016 06:30
-
-
Save vigo/d31d4c24906fab5ff9a8a3283671aba4 to your computer and use it in GitHub Desktop.
Show opened tab count of Safari
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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