1

I'm pretty new to Google Apps Script and the API, so please bear with me!

As part of a project I'm working on, I would like to retrieve all the comments that are present in the current revision of a file, hopefully using either Google Apps Script or the Google API.

The reason I want this is that the documents I'm working with have had many collaborators and many different revisions, and some of the people who were supposed to be 'resolving' comments didn't realise that even though deleting the text a comment is anchored to removes the comment from the user interface, this comment still counts as "open". i.e., these comments still appear in the comments thread, it just looks like they link to an earlier revision of the file.

Now, I want to retrieve all the comments present in the most recent versions of these files and -- say -- export them to a Google Sheet. However, if I choose all "open" comments, I get many, many more comments than I want, for the reason I stated above.

One possible way I was considering is to decipher the comment's anchor id "kix.xxxxxxxxxxxx", hoping that it would at least give me information on the revision history, but I see no documentation on this, and I'm not even sure it's possible since this is related to Google proprietary editor Kix.

I've read these articles that don't give me much hope:

However, If I download the Google Doc to a .docx, then I get only the comments that are present in the most latest revision, and this is what gave me some hope that maybe it would be possible to extract them using GAS.

I suppose if all else fails I could download all the documents and then try to get some sort of macro on Microsoft Word to extract the comments, but I decided to ask here before I resorted to that! If anyone could suggest any ideas, I'd be grateful!

Philip
  • 111
  • 1
  • 3
  • Maybe this might help? https://webapps.stackexchange.com/a/74978 – ScottMcC Jul 05 '18 at 14:34
  • 1
    @ScottMcC Sadly no. I basically only want comments which have anchors in the present revision, and since the list of comments doesn't seem distinguish between all *open* comments and comments *without an anchor* in the present revision, I'm right back where I started. Which is why I was hoping the anchor details might help me distinguish them! Thanks, though. – Philip Jul 05 '18 at 14:45
  • I haven't done this but try adding a value for `updatedMin`, this will get comments that were updated after this timestamp will be returned example value would be `modifiedDate` of the current revision. See [documentation](https://developers.google.com/drive/api/v2/reference/comments/list) to check the optional parameters. Hope this helps. – Mr.Rebot Jul 06 '18 at 11:58

0 Answers0