I'm trying to write a script that takes a string in a document in Google Docs and replaces it. The caveat is that I want to replace it using Google Docs suggestion mode, not only change the whole text, which gives my collaborators the option to accept the suggestion or reject it and get the text back to the original form. This is a built-in feature in Google Docs, but I couldn't find a way of using it through apps script.
Currently I'm using the code below:
var docBody = DocumentApp.getActiveDocument()
.getBody();
docBody.replaceText('Hi guys, as you can see, this video is a preview,', 'Oi pessoal, como você pode ver, este vídeo é uma prévia,');
But this is replacing the text, and I'd like to just suggest the second part (the part in Portuguese).
Is there any way to do that?