How want you execute the script?
It may toolbutton or menuitem or whatever.
The user can use the highlight tool.
How is the text selected?
User can select the text and will run the script. Then it should be highlighted.
Note: It is working fine in Adobe Reader but not working in Acrobat.
What is not working in Acrobat?
User selected text should be highlighted in acrobat using script.
What does you use in Reader?
Not possible. JS has no access to the current text selection.
For Adobe Reader "app.execMenuItem("Annots:TextEditMenu:HighlightSel")" using this. And it is not working in Acrobat.
What versions of Acrobat Reader and Adobe Acrobat does you use?
Adobe Reader X1 and Acrobat Pro DC.
The menu item is not more available in version DC.
Any other option in DC?
I don't know.
If it is the user who has to select the text, wouldn't it be easier and faster if he then simply right-clicked on the selected text?
We need this via scripting, and we have some other process after highlighting.
So user need to select text only.