Re: Shell script to get a list of all subfolders inside a folder
Re: Shell script to get a list of all subfolders inside a folder
- Subject: Re: Shell script to get a list of all subfolders inside a folder
- From: Shane Stanley <email@hidden>
- Date: Tue, 13 Oct 2015 10:13:45 +1100
On 13 Oct 2015, at 2:19 AM, Axel Luttgens <email@hidden> wrote:
>
> Probably not the most efficient, but should be quicker than Finder’s "entire contents":
>
> property mylist : {}
>
> set myfolder to alias "Macintosh HD:Users:bertus:Desktop:example folder"
>
> set myfolder to quoted form of POSIX path of myfolder
> set AppleScript's text item delimiters to {return}
> set mylist to text items of (do shell script "/usr/bin/find " & myfolder & " -type d")
The problem with using find -- and most shell commands -- is that they generally can't distinguish between packages and folders. So this is going to lump in packages such as .rtfd and .scptd files, not to mention .app files. Worse, it will include folders within packages.
On 13 Oct 2015, at 5:05 AM, Thomas Fischer <email@hidden> wrote:
>
> Something like
>
> set myFolder to choose folder
> list files myFolder conforming to {"public.folder"}
That looks promising, but when I try it here, the invisibles parameter fails.
On 13 Oct 2015, at 4:41 AM, Christopher Stone <email@hidden> wrote:
>
> What version of OSX are you running?
The 64-bit question...
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
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