How do I download previous saved revisions of a Google Apps Script?

前端 未结 2 1483
忘掉有多难
忘掉有多难 2021-02-15 11:45

I am still attempting to recover from somehow \'loosing\' a Google Apps Script when I created a copy of the script to fork the code to another project... My thought was to atte

2条回答
  •  粉色の甜心
    2021-02-15 12:25

    This is a bit manual but:

    • Create another script project
    • Include your original script as a library in your new script and select v1
    • In the new script add some code that uses your "library"
    • Use the script editor debugger to step into the library and you should see the code from the correct version

    For example if your library is called something like "MyOldCode", include some code like this in your new script:

    function getOldCode() {
      var a = MyOldCode.anExampleFunction()
    }
    

    Put a breakpoint below the "var a" line, run getOldCode() with the debugger and then step into anExampleFunction(). This will open up one file of your old code allowing you to copy and paste it elsewhere.

    You can then piece together v1.

    Edit 2019-04-11: There is also Romain's function for accessing old versions.

提交回复
热议问题