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:
- How to match comments on an image using kix anchor (or not) in Google Docs
- Anchor documentation does not exist?
- Creating anchored comments programmatically in Google Docs
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!