I am working on Google Apps Script. I want to share the Google Apps Script Editor to another account.I use Chrome browser.
I clicked File > Sharing in the editor. But I got this error:
I tried to remove all the cache and cookies and histories from the browser. but, same.
If you want to share a script bound to spreadsheet you need to share the spreadsheet itself
It is no possible to share a bound script is the spreadsheet is not shared
If the spreadsheet is shared, there is no need to explicitly share the script
Related
I have a google sheets which is linked to a form and a google scripts that was created in the menu of google sheets. This script runs fine and I use it to format the data. However, I have another script which I created from the google developer console, which sends and receives data from a website. I need this second script to get the value of a cell in the google sheets.
How can I link this second form to the google sheets while keeping the script already linked to the sheets?
When looking at responses to other questions they seem to be about individual sheets in a set so just to clarify, when referring to google sheets I mean the whole google sheets document. I only have one sheet anyways.
If it helps: The script I want to add acts a bit like a server and is being deployed by google scripts while the script that is already linked is only run when I call it on the sheets.
There is not way of attaching a standalone script to a document making it a bound script (which is the actual terminology for the script linked the the document).
The simplest way would be to copy-paste the code to the other script. You can deploy the bounded script.
If you really need more than one project for whatever reason, you can enable the Apps Script API and use projects.create (read reference) to create another one. If you don't know what this means, you probably shouldn't use it as it's finicky at best.
I found a solution which was to link the script to the google sheets using
var ss = SpreadsheetApp.openById("SHEET_ID_HERE");
I can then use ss.getActiveSheet().getRange().getValue();
and other funtions.
Thanks for the help!
I am using Google Apps Script to enable a custom drop-down menu in Google Slides. When I am asked to authorize the script, it asks for permission to View my Google Spreadsheets, but I don't use the Spreadsheet service in my code (I tried searching for "Spreadsheet" in my code).
Spreadsheets is listed in the project scopes, but I can't seem to remove it directly from there. The manifest does not show anything Sheets related. Any help would be greatly appreciated!
I have Google Sheet open for everyone
https://docs.google.com/spreadsheets/d/1H3slbaG_p6u3NihRDJfPECGF_teVoi-DGyJkDM5japg/edit#gid=0
And I have Google Apps Script that generates XML based on this Sheet.
https://script.google.com/macros/s/AKfycbza3jI02E9zQDB-VoVBrxpHTUq8QUY2lVrUd1bGuf5q5L7jOybq/exec
So can I allow everyone get result of this script without authentification?
Yes, you can allow everyone use your script by doing following changes :
Making Spreadsheet Open for everyone (Give Edit rights to Anyone with Link)
Attach script to that Spreadsheet (Open that Spreadsheet>Tools>Script Editor) and execute the script at least once to authorize it on your behalf.
If this doesn't work or you need anymore assistance then kindly let me know in comments.
I am looking to locally use a Google Apps Script with one of my Google Sheets (Attached to a form) that will be accessible to all emails that have permission to access the sheet, but I don't plan on publishing this script to the public. Do I still need to publish in order to use this script, or will I be fine just adding an onSubmit function for my Google Form as a trigger for my script to run in my Google Sheet? And can I use installable triggers if I plan on operating this script as a standalone only attached to this one Google Sheet?
Do I still need to publish in order to use this script
No: If you own the spreadsheet (or have editor permissions on it), your script can remain private. A script does not need to be bound to a Spreadsheet except if it will use:
Spreadsheet UI (getUi(), custom menus, dialogs and sidebars)
"Active" items (getActiveSpreadsheet(), getActiveSheet(), getActiveRange(), getActiveCell())
...will I be fine just adding an onSubmit function for my Google form as a trigger for my script to run in my Google Sheet?
Yes: Your standalone script can have installable triggers associated with Google Apps items such as spreadsheets, documents and forms.
And can I use installable triggers if I plan on operating this script as a standalone only attached to this one Google Sheet?
Yes: There's nothing special about the 1:1 relationship; the same trigger could be installed for multiple spreadsheets.
We have google spreadsheets with scripts embedded on it to generate data automatically from a remote server. I just want to know if it is possible to know if the modification on a certain sheet was done via google script or was edited manually in the edit history?
You could create a new user in your Google Apps domain that the script is 'run as'. That way you'll know whether it was the script or a user that made the edits