Skip to content

Instantly share code, notes, and snippets.

@juandesant
Created March 18, 2022 21:20
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 juandesant/ee3aa32ac1810005a450f2ae8cc9f1a3 to your computer and use it in GitHub Desktop.
Save juandesant/ee3aa32ac1810005a450f2ae8cc9f1a3 to your computer and use it in GitHub Desktop.
Uses AppleScript to reveal all files within a hierarchy, using the frontmost folder in the Finder
tell application "Finder"
-- get the folder that corresponds to the foremost Finder Window
set theFolder to the folder of the first window
-- alternatively, you could choose a folder with the form below
-- set theFolder to (choose folder)
-- get justTheFiles by using the every item of ... whose ... construct
set justTheFiles to every item of the (entire contents of theFolder) whose kind ≠ "Folder"
-- reveal them opens up new folders of each directory and subdirectory in the hierarchy below the current folder
reveal justTheFiles
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment