How do I name the current version of a Google spreadsheet, document or presentation using Google Apps Script?



I'm trying to give the current version of a Google spreadsheet a name using Google Apps Script. In the GUI I would do File -> Version history -> Name current version but since I need to do this to multiple files, I want to achieve this using a script.

I've found the revisions reference but that's not helping much.

This question touches on a similar topic, but I've found the revisions.items.splice(-1) doesn't always list the current version but rather the latest version.

Continue reading...