how to count files and folders separately

Say I have a folder with many files and subfolders.


How do I count within the folder the number of files and folders separately? Or count the number of total files but exclude the folder count?

iMac, Mac OS X (10.6.8)

Posted on Mar 7, 2016 5:46 AM

Reply
9 replies

Mar 7, 2016 7:57 AM in response to Daew

Try saving the following as an application:


on open this_folder

tell application "Finder"

set file_count to count every file of entire contents of this_folder

set folder_count to count every file of entire contents of this_folder

end tell

display dialog "This folder contains " & file_count & " files and " & folder_count & " folders." buttons "OK" default button "OK"

end open


(140395)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to count files and folders separately

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.