Re: How to get the number of items in a selected Folder ?
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