I hope everyone is in good health. I am new to AppScript and love the concept of automating the Google Docs using it.
What I tried;
I recently got into a problem where I needed to update the text according to its comment in Google Docs using AppScript.
Here is the demo but I came to know that it was not possible by using AppScript, so I have to use Google Drive API and I tried it but I still didn't got successful. It did seem to be changed when I try
console.log(comments.items[i].context.value);
but everything was same in my Google Doc, nothing seem to be changed.
Here is my code;
function listComments() {
let comments = Drive.Comments.list(DocumentApp.getActiveDocument().getId());
if (comments.items && comments.items.length > 0) {
for (let i = 1; i < comments.items.length; i++) {
let comment = comments.items[i].content;
let text = comments.items[i].context.value;
comments.items[i].context.setValue(`[${text}](${comment})`);
console.log(comments.items[i].context.value);
}
} else {
Logger.log('No comment found.');
}
}
I can't find the documentation anywhere for updating the Comment Context Value in AppScript which will also reflect in my Google Doc.
I hope you will be able to address my problem. Thanks in Advance !