Last active
November 3, 2022 13:23
-
-
Save digiltd/e1d84e44ab8b911ed8f7bc7cc33e9555 to your computer and use it in GitHub Desktop.
Count the amount of finder windows
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
property finderwindownumber : 1 | |
tell application "Finder" | |
set TotalNumberOfFinderWindows to (count of (every window where visible is true)) | |
if TotalNumberOfFinderWindows is greater than 0 then | |
tell application "Finder" | |
select window finderwindownumber | |
activate | |
set finderwindownumber to finderwindownumber + 1 | |
if finderwindownumber is greater than TotalNumberOfFinderWindows then | |
set finderwindownumber to 1 | |
end if | |
end tell | |
else | |
tell application "Finder" to open home | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment