On Sep 29, 5:51 am, Jim Correia <[email protected]> wrote:
> On Sep 29, 2009, at 3:36 AM, dannyg wrote:
>
> > I can't view the BBEdit dictionary in Snow
> > Leopard's Script Editor limits my exploration.
>
> This is a bug in the AppleScript Editor on 10.6. We have reported it
> to Apple and are working with them to resolve it.
I knew BB was working on a fix. Looking forward to it.
>
> That sounds like the wrong hammer for this particular problem...
I was always squeamish about my implementation, but see below.
> Independent of any issue above, you are probably better of writing
> something like this:
>
> tell application "BBEdit"
> set results to find "frobnitz" searching in {text 1 of text window 1}
>
> options {starting at top:true, returning results:true}
> set instanceCount to 0
> if found of results then
> set instanceCount to length of found matches of results
> end if
> end tell
> display alert (instanceCount as string)
>
One of my searches sometimes returns tens of thousands of results.
Using find causes Script Editor to crash (freeze, actually, requiring
a Force Quit). I don't know if this is an AppleScript or BBEdit issue
(probably the former), but it seems as though a huge list of found
results can cause a choke somewhere.
That's why I had been using replace (and even more squirrelly [prepare
barf bag], obtaining the count from the message property of found
matches), where the amount of data returned in found results is a list
of one object, regardless of count. Yes, it smells (and is
surprisingly fast), but I haven't found a way around the find-choking
issue or a classier alternative to obtaining counts of string matches.
In any case, adding saving no for each replace command has fixed my
immediate problem, for which I thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---