It\'s possible to retrieve elements of an open Google Docs document, starting from
DocumentApp.openById(doc_id, folder_id)
but the comments
Simple answer is you can't match reliably. The anchors simply aren't exposed in the Document API anywhere. If they were exposed, I'd expect them to appear as NamedRange or Bookmark entries, but neither appears populated by comment anchors.