I would like to get a list of comment and reply from doc and add content of comment and reply in sheet (3 first comments and replies) structured as:
Name of the file | date | update date | Url | Comment1 | reply1 | Comment2 | reply2 | Comment3 | reply3
The script I have now:
function listfichier(){
var sh = SpreadsheetApp.getActiveSheet();
var folder = DriveApp.getFolderById('ID_of_folder');
var list = [];
list.push(['Name', 'Date','update date', 'URL', Comment]);
var files = folder.getFiles();
while (files.hasNext()){
file = files.next();
var comments;
comments = Drive.Comments.list(file.getId());
Logger.log (comments.items.length);
if (comments.items && comments.items.length > 0) {
for (var i = 0; i < comments.items.length; i++) {
var comment = comments.items[i];
}
var row = []
row.push(file.getName(),file.getDateCreated(),file.getLastUpdated(),file.getUrl(), comment.content, comment.replies)
list.push(row);
} else {
Logger.log('No comments found.');
}
}
sh.getRange(1,1,list.length,list[0].length).setValues(list);
}
Is this even possible?