Last active
August 29, 2015 14:00
-
-
Save steshaw/d979da0612a384443ee2 to your computer and use it in GitHub Desktop.
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
set numTabs to 0 -- initial number of tabs | |
tell application "Safari" | |
set numWin to number of windows -- get number of Safari windows open | |
repeat with WinNo from 1 to numWin | |
tell window WinNo -- for each window, check how many tabs are open | |
set numTabs to numTabs + (number of tabs) -- sum those tabs up | |
end tell | |
end repeat | |
end tell | |
display dialog "Number of tabs: " & numTabs -- total number of tabs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment