I have a google docs created with App Script for which I am trying to place my cursor after a specific word in order to insert some content there.
When I just insert the content it inserts it at the end of the document. How can I find the specific word, set the cursor at the end of this word and then insert my content at this specific place ?
Please help me out !
You can achieve it by calling
Document.getCursor(). A thing to note is that this only works in bound scripts.Here's the example from the documentation:
Apps Script provides different ways to insert text, add a paragraph, insert text, add text ... It depends on the purpose of your script. In any case, you should check @Yuri's comment to better understand how Apps Script works.
Documentation