text explorer: exporting highlighted "show text" result to ms word or pdf
Dear community,
Is there a way to export the results shown in picture (show text of chosen terms/phrases) to a word or pdf format keeping the "text highlight" function as seen on picture? A JSL would be perfect.

Re: text explorer: exporting highlighted "show text" result to ms word or pdfhtml = "";
wordlist = {"room", "food", "staff", "clean"};
color = {"FFFF00", "00FFFF", "00FF00", "C0C0FF"};
For Each Row(
html = html || "<H3 id="toc-hId-1420607170">" || Titles || "</H3>"; // H1 or H2 is even bolder
rowtext = Reviews; // rowtext will be modified in the loop to add the color
for( iWord=1,iWord<=nitems(wordlist),iWord++, // each word, one at a time
rowtext = regex(
rowtext, // input to regex
"\!\b("||wordlist[iWord]||")\!\b", // find a word with word boundaries on each side
"<SPAN style="background-color: #"||color[iWord]||"">\1</SPAN>", // \1 is the word
IgnoreCase, GlobalReplace) // match food or Food, and multiple occurrences
);
html = html || rowtext || "<BR /><BR />"; // append each story and some blank lines
);
// add minimal HTML around the doc
html = ""||html||"";
// save and display
filename = savetextfile("$temp/deleteme.html", html);
open(filename);Re: text explorer: exporting highlighted "show text" result to ms word or pdfThank you, this is a sure solution but the JSL level is so high for me. May I request to adapt the script for attached table for words "room" food" "staff" "clean" ? From there on I guess I can do it for my table. Many many thanks in advance
Re: text explorer: exporting highlighted "show text" result to ms word or pdfpretty sure the text explorer "show text" window can't save the coloring. You could write some JSL to get the effect:
docs = "Text for Words: brown fox
the quick brown fox jumped over the lazy dogs back [1]
quick brown dog [2]
lazy fox jumped [3]
brown the lazy fox [5]";
// pick out the list of special words
wordlist = words(regex(docs,"Text for Words:(.*?)[\!n\!r]","\1")); // {"brown", "fox"}
// insert html into the documents to color the words
color={"FFFF00","00FFFF","00FF00","8080FF"};
for( iWord=1,iWord<=nitems(wordlist),iWord++,
docs = regex( docs, "\!\b("||wordlist[iWord]||")\!\b", "<SPAN style="background-color: #"||color[iWord]||"">\1</SPAN>", GLOBALREPLACE)
);
// insert breaks for newlines
docs = regex(docs,"[\n\r]","<BR />",GLOBALREPLACE);
// add minimal HTML around the doc
docs = ""||docs||"";
// save and display
filename = savetextfile("$temp/deleteme.html", docs);
open(filename);
formatted HTML with high-lighted words
Re: text explorer: exporting highlighted "show text" result to ms word or pdfWould be you be open to some sort of screen capture and then copy and paste for a short term fix. There is the Windows Snipping Tool which is free and Snagit is another option, but that has an associated cost. You can use these tools to select just the portion of the image you want and then copy and paste in a document as needed.
HTH