Download a spreadsheet from Google Drive / Workspace using Python

The https://github.com/burnash/gspread library is a newer, simpler way to interact with Google Spreadsheets, rather than the old answers to this that suggest the gdata library which is not only too low-level, but is also overly-complicated. You will also need to create and download (in JSON format) a Service Account key: https://console.developers.google.com/apis/credentials/serviceaccountkey Here’s an example of … Read more

Creating anchored comments programmatically in Google Docs

The Anchoring Comments feature from the Google Drive API is intended for non-Google Docs editors files, not for Google Documents. See https://youtu.be/ZBU52nacbLw?t=5m26s (credit to Bryan P who shared this URL through a comment) Unfortunatelly at this time the Document Service from Google Apps Script doesn’t include a Class Comment to handle comments and discussions. At … Read more

Convert a Markdown text file into a Google Document using Appscript?

One suggestion: use Pandoc to convert Markdown to docx, then import to Google Docs using the Google Drive API. You can also accomplish this using the Google Drive web interface: Convert markdown to ODT (or some other intermediate) using pandoc: pandoc MyFile.md -f markdown -t odt -s -o MyFile.odt Move the ODT file into your … Read more

Collapsing Elements in a Google Doc With Google Apps Script – Is This Possible?

You cannot do anything special in Apps Script, just automate stuff that you can do manually. So, there’s no way to do real collapsing, since there’s no such feature in Google Docs. But you can use available functionality in unorthodox ways and make it work for you. For example, you could save the content somewhere … Read more