Highlight predefined keywords
Highlights predefined keywords in text document.
(function () {
let keywords = ["justo", "test", "lacus", "et"];
let doc = Api.GetDocument();
for (let i = 0; i < keywords.length; i++) {
let searchResults = doc.Search(keywords[i], 0);
for (let j = 0; j < searchResults.length; j++) {
searchResults[j].SetHighlight("lightGray");
}
}
console.log("success");
})();
Methods used: GetDocument, Search, SetHighlight