Re: Stumped on BBEdit
Re: Stumped on BBEdit
- Subject: Re: Stumped on BBEdit
- From: Ricardo Montiel <email@hidden>
- Date: Tue, 12 Jun 2001 13:01:52 -0300
on 8 Jun 2001 07:15:24 -0700 (PDT), Bill Metzinger at
<email@hidden> wrote:
>
Hey now,
>
I'm stuck on multifile searches with BBedit. I'm doing the search in a
>
repeat loop where my search string is constantly changing but the context of
>
my hits stays the same. The hit returned each time is the first hit. What am
>
I not doing reset the hit?
>
>
>
tell Application "BBEdit 5.1"
>
set myfind to find mystring starting at mydir with multi file
>
set templine to context of first item of myfind as text
>
end tell
Hi Bill,
The result from a Multi file search is a list with all the hits at once, so
it is necessary to iterate on every item of the list (in the code you
posted, only the _first_ item is been processed), as in:
tell Application "BBEdit 5.1"
set myfind to find mystring starting at mydir with multi file
-- log myfind -- to see all the hits returned by the multi file search
repeat with mymatch in myfind
-- do your stuff here, as in the following example:
copy (context of mymatch) to templineList's end
end repeat
end tell
HTH
Saludos (Regards)
Ricardo Montiel
Buenos Aires - Argentina