Google App Script: Publish Script as owner - google-apps-script

I have a script which is bound to a document. Initially this script was written by friend, now I am taking care of this. I want to publish this script as add on. I have done all the formalities, as suggested by google.
When I clicked on Deploy as Docs Web add-on it gave me error, that Only owner of script can publish the script.
Is there any way to change the owner the of script.

Try making a copy the script file and deploying that copy.

Related

I can't create a script on a Google Sheet that I have edit access

We are using Google Workspace in my company and my boss explicitly shared a Google Sheet with me, so he is the owner and I have edit access. I am trying to create an App Script but when I try to access the Script Editor I always get the screen to request access on Google Drive.
Is it still possible to create a script or I am only allowed to create scripts in sheets that I am the owner?
According to Google's documentation on collaborating:
Access to bound scripts
Only users who have permission to edit a container can run its bound script. Collaborators who have only view access cannot open the script editor, although if they make a copy of the parent file, they become the owner of the copy and will be able to see and run a copy of the script.
So I just came across this issue.
Essentially I had my personal account and company account logged in on Google. For some reason, the Script Editor would try and access in with my personal account and when switching to my company account I would get the request access screen.
After logging out of my personal account I was able to create the script normally.

View/Manage Web Apps published through Google Apps Script Editor

Is there a way to view & manage the scripts I have deployed as a web app through the Google Apps Script Editor?
I stored a script on my google drive, opened it with Google Apps Script, and deployed via 'Publish -> Deploy as Web App'. After testing the script/webapp works correctly, I deleted the script project from my google drive and found that the web app is still functioning.
I can't find a way to view a list of, or manage the scripts after they have been published. Is there a console or dashboard that will show all my published scripts?
The file may still be available in the Trash or Archives folder. Searching for type:script will give you a list of all stand alone script files. Also type:script is:trashed will find any in the trash folder.
Finding files with bound scripts associated (the script is embedded in the file) as well as any with specific permissions can be done by looking at your account's permissions. This will list every file that has had some sort of permission request. If a bound script does not require any permissions granted, I know of no way to finding the file. To see the files you have granted permission to, use this link: https://myaccount.google.com/permissions

How can I create spreadsheet with included gs script by API?

I'd like to manage spreadsheets (uploaded by a client via API) over google engine. I created test spreadsheet extended by functions in .gs script (which works great if I add them via online editor) but I do not know how to apply such a .gs script to every uploaded spreadsheet automatically (possibly via API).
Moreover, I do not want to share this .gs file by publishing it as an extension (because of security policies).
Updated: I also tried copying existing spreadsheet with working gs script and overwriting its spreadsheet data via API (instead of uploading new one) - it's overwritten data successfully but unfortunately lost gs script. Details are described in separate (bounty) question: Custom google app script doesn't work after copying spreadsheet with google java client
So I've even tried copying using plain HTTP methods since I thought it might be a problem with Java SDK but it still didn't work which means that there is some problem at google side (or something is really unclear) with service accounts.
After all I solved the problem with another approach.
First I copy spreadsheet with script attached to it to my service account (as I described in this Custom google app script doesn't work after copying spreadsheet with google java client topic). The file is copied with broken script.
Then I make user authorize using google's oauth (this tutorial shows how https://developers.google.com/identity/protocols/OAuth2WebServer#overview)
And then on his behalf I perform copying.
Finally the file is on his private drive which is the biggest downside of this solution but at least the script works which was my main goal.
Hope it helps ;)
You can publish a google script without it going on the Marketplace. If you make a Google group you can publish in such a way that only members of your google group can see it. If your google group only has you, only you can see it. Then it will be on all of your spread sheets.
The downside being that google will never let you remove it from their server, only unpublish it.
You can create a stand-alone script that is independent of any spreadsheet. This script would contain any methods/functions needed to create and manipulate spreadsheets according to your use case. Furthermore you could deploy the script as a web-app and implement a doGet() or doPost() method. Whenever a user uploads spreadsheet data via API you can call the web app with the information and have it create spreadsheets as needed.

Google docs scripts asks for permission everytime

So my question i have a google docs template which has a script with certain autofill criteria. After you click on use this template fine you get a file and when you run the script everytime is asks for permission to access the certain things google needs to identify you, it basically acts like its a new app everytime you create a new file from the template.
Is their a way of setting it won't ask for permission everytime?
If you have a document bound script in your document, and if you will make a copy of that document and run the script, google app script will ask permission every time. Copying the document with script acts as if you have created a new script file and now script will ask permission on its first run.
Possible solution
You can publish your script as google document add-on. If you don't want to expose it publicly, you can also publish the add-on privately which only you or someone you will share with, can use.
check out the documentations
https://developers.google.com/apps-script/add-ons/publish#development_checklist
https://developers.google.com/apps-script/add-ons/domain-wide#publishing_for_domain-wide_installation
Publishing the add-on will bind your add-on to every document for google apps.

Deploy and use Google Sheets add-on with Google Apps Script

I'm working on a Google Sheets add-on in Google Apps Script and want to know how I can deploy it and install it into a Google Sheets spreadsheet whilst it is still in development (i.e. not ready to publish in the Store).
At the moment I'm forced to create my add-on embedded within an existing spreadsheet with no option of using it in another.
Has anyone achieved this yet?
Go to Publish>Test as Add On and Configure a New Test. Testing your script will run the code on a doc of your choosing.
You should be able to take it from there. If you're still having trouble, read on.
To setup the test, you'll need to specify which Document, Form, or Spreadsheet you want to it to run on, and save the test. Then you can run the test (from the Test as Add On popup, by clicking the Test button after you've saved your test setup) and it will execute your code on that document/spreadsheet/form by opening a new tab with that doc and executing your code.
To share the script with others (beyond making them use this same process for themselves by copy/pasting your script in their own Script Editor) you'll need to publish it to the Web Store; to do that you need to do all this stuff.
Hope that helps!
Yes its posible but first you need to be approved by google to publish.
Once you can publish you specify to publish only to a google group and not public (this is standard chrome store functionality)
I tried to do the same thing but was not able to. I just copied and pasted my code into the script manager to test with different spreadsheets.
Sorry, but I guess not.