Re: Get every file of the entire contents of a folder. Quickly.
Re: Get every file of the entire contents of a folder. Quickly.
- Subject: Re: Get every file of the entire contents of a folder. Quickly.
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 14 Oct 2003 08:07:44 -0700
On 10/14/03 7:36 AM, "Paul Skinner" <email@hidden> wrote:
>
Unfortunately, there was a major bug in the code I wrote. Grep was not
>
the way to go for the containing search. I was getting hits where the
>
file path contained the search term. The 'find' shell command has it's
>
own switch for this. And the results are not only more accurate, but
>
they come back quicker!
It looks even better. But I must be missing something: you're still doing
'as text' when it should be 'as Unicode text' since file- and folder- paths
may well contain non-ASCII characters.
set folderReference to (parameters's item 1 as text) as alias
should be
set folderReference to (parameters's item 1 as Unicode text) as alias
In fact, the 'folderReference' is to (choose folder) in the example you
give, and 'choose folder's result is an alias to begin with. Perhaps all
this in case a Finder folder-reference is given instead? In that case (or in
any case) why not just 'as alias'? Why do you need 'as text' or 'as Unicode
text' at all, 'as alias' will work with Finder, string or Unicode paths, or
alias references? What am I missing here? And if it does need first coercion
to text, why not Unicode text? And why this lower down:
set filelist to (DiskName & (filelist as text) as Unicode text)
Why not just:
set filelist to (DiskName & filelist) as Unicode text)
Why lose the Unicode in the paths before coercing it back? You'll lose all
the non-ASCII characters that way and will get errors if there are any.
Since I already mentioned this (you didn't replay that time), and you're
still doing it, you must have a good reason I'm missing - maybe some
situation I haven't considered. Please tell. The method itself looks
terrific.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.