Missing Google Apps Script source, deployed app wo

2019-09-03 06:21发布

问题:

I use the https://script.google.com editor to edit my Google Apps Scripts. One of my scripts is 'missing' and I can not find it anywhere on my Google Drive. The 'deployed web app' continues to work though. Is there any means to recover this script so that I can edit it again?

On 2 October 2015, I used the 'Make a copy' option within script.google.com for this script to branch it off for another project. I am worried that this step may have removed the previous script's source? I just now tried a test of this action and it properly resulted in two distinct scripts. Hmmm.

For my 'copied' script, I did save an initial revision of it within script.google.com, so perhaps I could revert back to that revision and get a close copy to what I started off with. But I can not figure out how to revert the code back to that revision either.

Here's an image of what shows on drive.google.com for the copied script.

回答1:

Here is some code that you can run to search for the file:

function getTheFile() {
  var files = DriveApp.searchFiles('title contains "Partial Name Here"');

 while (files.hasNext()) {
   var file = files.next();
   Logger.log(file.getName());
 }
};

Where it states: "Partial Name Here" Enter the name of the file, or a partial text of the file name.

If you can find the file in code, and you own it, you can make a copy of it with DriveApp.