Is there some method within Script Debugger to find and select or highlight every instance of a search string? If not, is there some way to do this with a script? The following works conceptually but I want all matching search strings to be selected or highlighted at one time. Thanks for the help.
set theSearchString to "search"
tell application "Script Debugger"
set search wraps to true
set search string to theSearchString
tell document 1
set startCharacterRange to character range of selection
set firstCharacterRange to (search with action find first)
set character range of selection to firstCharacterRange -- delete line
delay 0.5 -- delete line
-- select or highlight the search string -- add line
repeat
set nextCharacterRange to (search with action find next)
if nextCharacterRange = firstCharacterRange then
exit repeat
else
set character range of selection to nextCharacterRange -- delete line
delay 0.5 -- delete line
-- select or highlight the search string -- add line
end if
end repeat
set character range of selection to startCharacterRange
end tell
end tell
BTW, an easy solution would be to create a list of lists with each individual list being a character range, and then to have Script Debugger select the character ranges as in the following, but that appears not to be supported.
tell application "Script Debugger" to tell document 1
set character range of selection to {{10,4} {20,8}}
end tell