recursive folder count
recursive folder count
- Subject: recursive folder count
- From: Tim Piper <email@hidden>
- Date: Thu, 28 Feb 2008 20:19:39 +0000
Hi folks.
I need to count the number of items in folders recursively
but this only does the 1st level:
------------
set target_folder to choose folder with prompt "Choose target folder to clean" tell application "Finder" set filecount to count item target_folder end tell display dialog "There are:" & filecount & " files"
----------
now I know your going to say use a 'do shell' something like:
--------- set target_folder to choose folder with prompt "Choose target folder to clean" set posixfolder to POSIX path of target_folder set filecount to do shell script "ls -l " & quoted form of posixfolder & " | wc -l | awk '{print $1}'" display dialog "There are:" & filecount & " files"
--------
but the problem here is the folder path selected may contain illegal 'shell' characters thus it breaks the shell script.
suggestions.... speed is important here, so shell script is the preferred method.
thanks.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden