The following AppleScript will change the specified font on each word of the first occurrence of the string in the Pages v7.0 document. Since we are simply matching document words to the words in the string, it is a much more difficult problem (at least late at night) to match all occurrences of the provided string, and change these fonts too.
property HNR : "HelveticaNeue-Regular"
property HNI : "HelveticaNeue-Italic"
property HNB : "HelveticaNeue-Bold"
set fontface to HNB
try
set theStr to text returned of (display dialog "Enter your text string: " default answer "" buttons {"Cancel", "OK"} default button "OK")
on error errmsgnumbererrnbr
return
end try
tell application "Pages"
tell body text of front document
set bodyText to a reference to it
my change_string_font(bodyText, theStr, fontface)
end tell
end tell
return
on change_string_font(btext, aStr, afont)
set strCnt to count of words of aStr
set theCnt to 0
set {TID, AppleScript'stext item delimiters} to {AppleScript'stext item delimiters, space}
set theStrWords to text items of aStr
set AppleScript'stext item delimiters to TID
repeat with aword in words of btext
if theCnt = strCnt then exit repeat
if (theStrWords contains aword) is true then
set font of aword to afont
set theCnt to theCnt + 1
end if
end repeat
return
end change_string_font