I want to search a window of text, but I don't want to continue to
find the same text that I previously found. How do I do that? I have
tried to set the insertion point after the found text block, but I
can't make that work. The script is posted below. Thanks for any
help, I'm sure this isn't that hard I just haven't figured it out.
tell application "BBEdit 6.5"
make new document
set selection of text window 1 to page_source
set searchStr to "Position: [\\d]+:[\\d]+:[\\d]+
Score: [\\d]+"
set do_again to true
select insertion point before first line of text window
1
repeat while do_again
set zFindResult to find searchStr options
{search mode:grep,
returning results:true, starting at top:false, showing results:false}
searching in text 1 of text window 1
-- the line below is a problem. the script
seems to constantly
keep finding the same string
select insertion point after selection of text
window 1
--if found of zFindResult and length of found
matches of
zFindResult > 0 then
if found of zFindResult then
set ResultText to found text of
zFindResult
set selection of text window 2 to
ResultText & return & return
select insertion point after last line
of text window 2
--replace (searchStr as string) using
("" as string) options
{search mode:grep, starting at top:true} searching in text 1 of text
window 1
else
set do_again to false
display dialog "done"
close window 1 saving no
end if
end repeat
end tell
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
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 specific feature request or would like to report a suspected (or
confirmed) problem with the software, please email to "[EMAIL PROTECTED]"
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---