In a script bound to a Google Sheet, how can I learn the ID (not the name) of the folder containing the current sheet? I want to do this:
var files = DriveApp.getFolderById('0B9momRZYw4DVTlJVeXNpX25BemM').getFiles();
but using a variable that represents the folder ID, like this:
var files = DriveApp.getFolderById(folderId).getFiles();
The problem is I cannot figure out how to obtain the parent folder's ID. I realize the current sheet may reside in several different folders (mine doesn't), but surely there is some way to get the ID of the folder?