Here is my solution.
It cycles through the pages and then uses delimiters to split the text on the desired character. It then uses the length of each text item to locate the target, rejoins the text and changes the font/colour of each match. If the match was multi-character, it would likely require a change to the set ch to ch … line. Not sure whether multi-byte characters would be affected. I change the colour to make the results more noticeable.
As @nickpassmore notes, if the different font ends up moving text to another page while that page is being processed, then it will fail when it seeks the moved sample. I thought of reversing the order but it’s more of a pain with my method so I’ll simply note the issue although I may revisit this.
My mac is kinda slow. I’m working with a 66 page, 160k text (with 24k words) that has 128 matches and it takes about 20 seconds to complete the change of font and colour. Using post23’s script took 1:55 for me, as a reference.
If you manually set the value of ‘pct’ in the repeat line, then you can limit the pages processed so you can test it on a smaller sample.
set black to {0, 0, 0}
set red to {64764, 10794, 7196}
set origFont to "Helvetica Neue"
set nextFont to "Arial"
set delim to "»"
tell application "Pages"
activate
set pageList to pages of document 1
set pct to count of pageList
-- cycle pages
repeat with pp from 1 to pct
tell page pp of document 1
set AppleScript's text item delimiters to ""
set sheep to body text
set AppleScript's text item delimiters to delim
set sheepList to my pageBreakdown(sheep) -- list of delimited text of page
-- reset for each page
set sheepLength to {} -- length of each text item
set ch to 0 -- index of matching character
-- cycle text items to get each length
repeat with x in sheepList
set end of sheepLength to count of x
end repeat
-- cycle text items
repeat with l from 1 to ((count of sheepLength) - 1) -- exclude trailing text item
set ch to ch + (item l of sheepLength) + 1 -- index of matching character
-- set chr to character ch of body text -- matching character, used for logging
set color of character ch of body text to red -- {64764, 10794, 7196}, {0, 0, 0}
set font of character ch of body text to nextFont
end repeat
end tell
end repeat
end tell
set AppleScript's text item delimiters to ""
-- break page's text into list, splitting on desired string
on pageBreakdown(eachpage)
set sheepList to a reference to (get text items of eachpage)
end pageBreakdown