• 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: How to get the number of items in a selected Folder ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the number of items in a selected Folder ?


  • Subject: Re: How to get the number of items in a selected Folder ?
  • From: Jim Weisbin <email@hidden>
  • Date: Thu, 26 Nov 2015 15:19:58 -0500

Yvan KOENIG <email@hidden> wrote:

set x to choose folder with prompt "Choose Folder to Count Files"
set filecount to do shell script "find " & POSIX path of x & " ! -type d ! \\( -name \".*\" -or -name \"Icon*\" \\) | wc -l"
display dialog filecount


why not :

set x to choose folder with prompt "Choose Folder to Count Files"
tell application "System Events"
count (get files of x whose visible is true)
end tell

My version gets all files including those in sub-folders, but apparently that was not what was asked for. That can be changed with the -depth n switch. Just offering it as an alternative. 

Jim Weisbin | C.T.O. | human 
 _______________________________________________
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

  • Prev by Date: Rép: How to get the number of items in a selected Folder ?
  • Next by Date: Re: AppleScript-Users Digest, Vol 12, Issue 583
  • Previous by thread: Re: How to get the number of items in a selected Folder ?
  • Next by thread: [ANN] BridgePlus script library 1.3
  • Index(es):
    • Date
    • Thread