• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: recursive folder count
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recursive folder count


  • Subject: Re: recursive folder count
  • From: "Mark J. Reed" <email@hidden>
  • Date: Thu, 28 Feb 2008 16:23:35 -0500

Do you want all items or just subfolders?

I think this will work (untested):

tell application "Finder" to count(get entire contents of sourceFolder)

You might be able to restrict it to subfolders with a whose clause.

Or to count only subfolders using find:

Do shell script "find " & quoted form of POSIX path of sourceFolder &
" -type d -print | wc -l"


On 2/28/08, Skeeve <email@hidden> wrote:
> It shouldn't break your script as you already used "quoted form of ..."
>
> I wouldn't use ls and sed but just find:
>
> set target_folder to choose folder with prompt "Choose target folder to
> clean"
> set filecount to do shell script "find " & (quoted form of POSIX path of
> target_folder) & " | wc -l"
> display dialog "There are:" & filecount & " files"
>  _______________________________________________
> 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
>


--
Mark J. Reed <email@hidden>
 _______________________________________________
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

  • Follow-Ups:
    • Re: recursive folder count
      • From: Peter Baxter <email@hidden>
References: 
 >recursive folder count (From: Tim Piper <email@hidden>)
 >Re: recursive folder count (From: Skeeve <email@hidden>)

  • Prev by Date: Re: linebreak in a shell script; was Re: What's wrong with this call to zip?
  • Next by Date: Re: linebreak in a shell script; was Re: What's wrong with this call to zip?
  • Previous by thread: Re: recursive folder count
  • Next by thread: Re: recursive folder count
  • Index(es):
    • Date
    • Thread