Highlight predefined keywords
Highlights predefined keywords in document.
(function () {
let keywords = ["lorem", "ipsum", "dummy", "many"];
let doc = Api.GetDocument();
for (let i = 0; i < keywords.length; i++) {
let searchResults = doc.Search(keywords[i], false);
for (let j = searchResults.length - 1; j >= 0; j--) {
searchResults[j].SetHighlight("lightGray");
}
}
console.log("success");
})();
Methods used: GetDocument, Search, SetHighlight
Result

