Last active
June 5, 2019 12:49
-
-
Save ChristoferK/e83f31cdf6f77a7c8599ce926bb19b8d to your computer and use it in GitHub Desktop.
[Get Empty Sub-Folders] Retrieves a list of empty sub-folders in a specified folder #AppleScript #System_Events #Finder #folders #empty #aliases
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
use application "System Events" | |
on directories of directory without contents | |
local contents | |
tell (a reference to the POSIX path of every folder in ¬ | |
the folder named directory) to if contents then | |
return it where alias is in the class of aliases | |
else | |
return it where true is not in visible of items | |
-- For COMPLETELY empty folders without invisible files: | |
-- it where alias is not in the class of aliases | |
end if | |
end directories | |
directories of "~/" without contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment