Hi all, I’m new to OnlyOffice and I can’t find a solution to get selected text from Document as a STRING. I want to create a plugin that does something with selected text.
Example : from sentence “Hello world!” I want to select “Hello” and get it as a STRING. I tried this (and many other solutions), but it doesn’t work :
function GetText() {
var sText = window.getSelection().toString();
sText = “123” + sText + “456”;
return sText;
};
It returns “123456” instead od “123Hello456”.
I use desktop computer with Windows OS and Onlyoffice version 8.0.1.31 (x64 exe).