danthareja / node-google-apps-script

[DEPRECATED - use clasp instead] The easiest way to develop Google Apps Script projects
MIT License
353 stars 70 forks source link

Cannot push with non-standalone file #66

Closed AdrienLemaire closed 6 years ago

AdrienLemaire commented 6 years ago

I have a script bound to a spreadsheet file, and I was able to gapps init id using the script id from the Project properties. It downloaded my files without any problems.

On the other side, when trying to gapps push, it returns the File not found error. Is that why you recommended to only use standalone scripts ? I'm a newbie with google scripts, what would then be the good practice to access a spreadsheet's data from a standalone script ?

Thanks in advance for the support

oshliaer commented 6 years ago

You can't edit bound scripts.

The best way for me is create a trigger programmatically https://developers.google.com/apps-script/guides/triggers/installable#managing_triggers_programmatically

function createSpreadsheetEditTrigger() {
  var ss = SpreadsheetApp.getActive();
  ScriptApp.newTrigger('myFunction')
      .forSpreadsheet(ss)
      .onOpen()
      .create();
}
lricoy commented 6 years ago

Hey @Fandekasp . Did that solution work for you? I will close this but please reopen if needed.