Total Number of Files/Folders?

Ok I would like to count the number of files/folders within a large folder directory i.e. iTunes Library, but I can't seem to find a way to do this on my iMac?? Usually with Windows systems, you would just right click and Properties and it would tell you the total number of files and folders within that directory. How do you do this on an iMac because I usually like to keep a track of the total number of files/folders within a directory???

Sounds like a very basic thing but I can't seem to figure it out on the iMac, please help people!!!

iMac 21.5, Mac OS X (10.6.5)

Posted on Jan 7, 2011 7:05 PM

Reply
13 replies

Jan 7, 2011 7:21 PM in response to Niel

Niel wrote:
Open the AppleScript Editor in the /Applications/Utilities/ folder and run:

tell application "Finder"
{count files of entire contents of (selection as alias), count folders of entire contents of (selection as alias)}
end tell

(56027)


When you say run, do you mean using Terminal in Utilities?

How do I tell application "Finder" to count files of entire content as alias? I'm new to Mac please help Niel?

Jan 7, 2011 7:50 PM in response to aznblaze

1. Yes.

2. Try using:

on open this_item
tell application "Finder"
set theText to "File count: "& count files of entire contents of this_item & return & "Folder count: "& count folders of entire contents of this_item
display dialog theText buttons "OK" default button "OK"
end tell
end open

saved as an application.

(56030)

Jan 7, 2011 8:03 PM in response to Niel

Niel wrote:
2. Try using:

on open this_item
tell application "Finder"
set theText to "File count: "& count files of entire contents of this_item & return & "Folder count: "& count folders of entire contents of this_item
display dialog theText buttons "OK" default button "OK"
end tell
end open

saved as an application.

(56030)


Ok this is just the way to save it as an application.

I just tried selecting 3 folders at once and running the script to count the files and folders but it said Script Error? Is there a way to count a large quantity of files and folders easily like Windows within a folder directory?

Jan 7, 2011 8:07 PM in response to aznblaze

I just tried selecting 3 folders at once and running the script to count the files and folders but it said Script Error?


These scripts only work for one dragged item or selected folder at a time.

Is there a way to count a large quantity of files and folders easily like Windows within a folder directory?


Not without third-party software.

(56031)

Jan 7, 2011 8:15 PM in response to aznblaze

aznblaze wrote:
Niel wrote:
2. Try using:

on open this_item
tell application "Finder"
set theText to "File count: "& count files of entire contents of this_item & return & "Folder count: "& count folders of entire contents of this_item
display dialog theText buttons "OK" default button "OK"
end tell
end open

saved as an application.

(56030)


I copied and pasted the above and saved it as an application but it doesn't run when I click on it after saving it??

When I do save it as an application through AppleScript Editor to the desktop, do I need to tick any of the option boxes when saving which are as follows;

1. Run Only
2. Startup Screen
3. Stay Open

Jan 8, 2011 8:42 AM in response to aznblaze

aznblaze wrote:
Niel wrote:
Open the AppleScript Editor in the /Applications/Utilities/ folder and run:

tell application "Finder"
{count files of entire contents of (selection as alias), count folders of entire contents of (selection as alias)}
end tell

(56027)


This script works well but how do I get the script to work as an application?? I tried saving it as an application through AppleScript Editor but it doesn't do nothing once it is saved. I even tried dragging a folder on to the created application icon on the desktop but nothing...

Please help??

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.

Total Number of Files/Folders?

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