Use script in all spreadsheets - google-apps-script

I'm in the process of completely switching from excel to google spreadsheets. I'm writing a set of simple scripts that will help me be productive. Is there any way to make it so that these scripts are inherited by all google spreadsheets that I open (new + existing) from my google account? I know I can publish an add-in, but short of this...
In other words, when I open a new google spreadsheet I'd love to have my custom menus & functions automatically be available.
Thanks!

Add-ons for Google Sheets, Docs, and Forms provide this capability.

Related

Auto-generation of a Google doc based on google sheets selection + additional data

Requirement: Auto-generation and completion of a Google doc based on selections made by filtering options in Google sheets
Step-by-step:
There are x options listed in a spreadsheet.
I reduce them to the number I need via filtering.
I then have these options + the expanded details automatically added to a google doc template I've designed.
As an unexperienced programmer, it's very likely that the most convenient way to do something like this is by using Google Apps Script as it has services that help to extend Google Sheets and Google Docs among other Google apps. This service use JavaScript as programming language and it's possible to create and manage the script by using a web browser.
Experienced programmers that don't want to invest too much time on doing this might also find convenient to use Google Apps Script, but they might prefer to use the tools used for other projects might use CLASP or the Google Apps Script API.
Besides using Google Apps Script this could be done by using Google Docs API, Google Sheets API, Google Drive API and Google Cloud.

How to implement VBA All Sorts in Google Sheets?

I have been given a task, where there is a group of people in a excel spreadsheet, in which the owner can mark if a person has arrived or not. Which can be done in excel by using VBA All Sorts. But I don't how to implement this in Google Sheets. Is there some workaround to this?
I I have tried looking at the documentation for google-script-apps, and various how-to guides of designing a userform for a Google Sheets document.
I am afraid, that I can't provide some code as I haven't a clue of how to implement VBA All Sorts in Google Sheets.
what you should look into is Google Web Apps. You can create an HTML page with Google Spreadsheet as database. You can create the HTML page with all the options you want and then write/read the data from Google Spreadsheet by calling Javascript functions in the HTML talking to google.script.run.XXXX() Google Apps Script functions.

Is it possible to hide Google script from google sheet?

I have a Rest API available which I would like to make available via an Google sheet for less tech oriented people. I was wondering if it is possible to hide the google script from the sheet if I share it with people? I have some sensitive information in the code like the authentication etc which I would like to hide. Moreover, it would be nice if they can't infer with the code. Is this possible?
The only secure way is to create an add-on.
Related
How to protect the Apps Script code in a Google spreadsheet?

Google Scripts in Spreadsheet

Is there a way to have a spreadsheet in Google Drive where the script is protected from modification / editing? Does anyone know if that is an option in the Script editor?
Another thing I'd like to ask. How does one do source control for the codes in their Google scripts?
Thanks.
WRT privacy / protection of scripts: Refer to the comments and answers on this question: How to protect the Apps Script code in a Google spreadsheet?.
Source Control? See Backing up Gapps source. The version tracking in the script editor is rudimentary, so you should consider doing source control outside - you'll have to get used to copy & paste.
No you can't do it.
The script runs with the document permissions.
If you have Edit permissions on the document, you have edit permission on the script too.
Here's the Google spreadsheet developer guide.
https://developers.google.com/apps-script/reference/spreadsheet/

How to make set of scripts available for all my Google Spreadsheets?

Excel supports the concept of a PERSONAL.XLS file which contains my personal scripts, which I want to be able to use on any spreadsheet/workbook that I open.
How do I do similar in Google Docs, i.e. have a set of scripts which, regardless of which Google Spreadsheet I open, will cause the onOpen event to be run and will thus add my extra menu?
You cannot do that in Google Spreadsheets. However the best practice is to
Write a standalone script with your onOpen and other functions.
Publish this as a library
Write a shell onOpen in each of the spreadsheets that you create
manually. :( This shell function will call the library's onOpen.
However, if you create a copy of a spreadsheet that has an associated script, then the copy will also have the script in it.
1) You can open your Script and from the Publish menu select "Test as add-on".
2) Now under "Configure New Test" you can select a document and then run the add-on for that doc.
Unfortunately you have to do this for each document one at a time. I would really love it if there was a way to tell a script to be available for all my spreadsheets, or at least have an easy way to install a personal add-on on a per-sheet basis just like you can install an add-on from the marketplace, kinda like a personal marketplace.
Although not recommended, You can also copy set of scripts to all other google spreadsheets programmatically using AppsScriptApi