1
votes

I have google spreadsheet with script and sidebar (html input fields). I will share this spreadsheet with my colleagues. and my colleagues will make a copy of my spreadsheet for personal use.

this is problem

  • when I edit my script, I want to edit my colleagues's spreadsheet script that copies of my spreadsheet.

  • for this, Here is my idea.

    1. when my colleague run specific button(scirpt) on sheet first of all before use sheet, automatically I get edit permission of that spreadsheet. and then I go to my colleagues's spreadsheet script and edit it. Is their any script for this?
    1. one script file and run multiple spreadsheets. my script is for input some data specific sheet and cell by html input form on sidebar. There are several input forms and specific sheet names and cell addresses are specified to set values. Is their any way for 2? I've tried publish add-on. but didn't work well. plz give me some idea.
1
You can edit script files using google-apps-script-api provided you have necessary permissionsTheMaster

1 Answers

2
votes

For the first part, you can just add the lines;

var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addEditor('----@-------');

To directly create / edit script files you'll have to use the App Script API

App Script API

For the second part, you can write the scripts in a stand-alone file and use the script library in the spreadsheet. Leaving the script in development mode will always use the current code in the script file.

Apps-script libraries