Currently i'm writting a script, that marks a word as a indexentry. But i have to select the word and then i can use the macro. I would like to have, that the word under the cursor is used. Therefor i found this feature requests https://sourceforge.net/p/texstudio/feature-requests/219/
However the following code produces an error
idx = cursor.selectedText(WordUnderCursor)
Uncaught exception at line 1: ReferenceError: Can't find variable: WordUnderCursor
According to the feature requests the wordundercursor function is implemented. Can anybody help me?
Thank you for your help.
There are two things:
This should work:
idx = cursor.selectedText()
Thank you, works perfectly.
Yesterday i'm slow on the uptake. It makes sense, that i have first to select the text and then retrieve.
I wanted to add the script and other to the wiki page (https://sourceforge.net/apps/mediawiki/texstudio/index.php?title=Scripts), but i haven't the permission to edit this page.
Should now be possible
Thanks, done, closed.