In the left pane of the google apps script editor, there is a button for a new folder. I have not been able to find out what one can do with this.
The Google Apps Script Editor doesn't include folders as a built-in function, but you could use Google Drive folders to organize files, including Google Apps Script project files but not the internal .gs and .html files.
The answer was in the two comments: the pane labeled "New Folder" was put there by the extension, AppsScript Color, which I tried at one time.
Related
I copied a spreadsheet to be used by multiple people with script attached. My question is how do I modify script in the project without having to copy and paste each change to .gs files in the project?
This is the base document from which the other versions were copied:
Create a central script and then publish it as a library. Have your template linked to the library. Make sure that the template is using the "dev" version of the library so that any future changes will be reflected for everyone.
There ARE ways to manipulate the GS files using clasp but it is much less straightforward than using libraries and overkill for this use case.
https://developers.google.com/apps-script/guides/libraries
Yes, it's possible to "upload" a .gs file to an existing Google Apps Script project. To do this you might use CLASP, GAS GitHub Assistant (a Chrome extension) or directly the Google Apps Script API.
Please bear in mind that you also could alleviate these pains (having to update the bounded to spreadsheet GAS project copies) by taking a different approach. You could use libraries or to create a Workspace Editor add-on.
Libraries help by keeping a big part of your code in a single place but you might still have to update the copies i.e. if you are using simple triggers like onOpen and onEdit or if you change library function name, add a new function, etc.
Add-ons help by keeping all the code in a single place bu you have to publish the add-on to the Google Workspace Marketplace. If you have a Google Workspace account the add-on can be published for internal use.
I have some scripts which make copies of files and folders in Google Drive so users won't have to do this manually, but at the moment these scripts are just script files sitting in the drive and users need to open and run the script. I don't want the users to have to click Run > Run Function, and see the code, etc, so I'm looking for a better way to deploy these.
Ideally, the scripts would appear in a dropdown menu when the users went to their Drive. Is there a way to do this?
I'm considering just creating a Doc. Then users will have to open the doc whenever they want to run one of the scripts, but at least they won't see all the guts. I'm new to Apps script, so I might be overlooking an obvious, better solution...
Google Apps Script doesn't have a way to add UI elements to Google Drive web UI.
I think that this could be achieved by creating a Chrome Extension but I didn't tried this yet.
Reference
https://developers.google.com/apps-script/guides/menus
https://developers.google.com/apps-script/guides/dialogs
I have developed few scripts in a given project attached to a spreadsheet (ie that I first created my spreadsheet, and then created the project with the menu Tools>Script editor).
Now my question is:
how can I save that project so that it can be used on other spreadsheets?
how do I select in a given spreadsheet which script project I want to use?
From this Google documentation page I can't see any solution.
To have a script that's not bound to any document, look into making a standalone script.
If you want to use a script in multiple documents, you'll need to publish it as a library.
I work for a university which uses Google App for EDU. Recently, I decided to begin testing app script to see how it could be of use to our organization. I have been able to create new app scripts and run them without issue. However, I have found that once I close the browser editor tab, I am not able to retrieve any script I've wrote unless I have the editor url saved (ie. I dont see any of my script in my google drive). Is there a particular app script site where my scripts are listed?
Thanks,
Bryan
The long method i use to get to see all my App Scripts is:
open an existing spreadsheet, or simply create a new spreadsheet
go to Extensions > Apps Script
click on the "Apps Script" logo in the top left corner
This will take you to: https://script.google.com/home
The short method is just to have that link (above) saved on browser toolbar and click it whenever i need to.
to be able to starts new script from the drive you have to connect script app to your drive using the Browser interface like below :
from the connect more apps at the bottom search for "script" and add it.
If you created scripts from inside a spreadsheet, they are tied to that sheet and will not show up in Drive; you can find them via the "Script Manager" menu in that spreadsheet.
All standalone scripts will be visible in your Google Drive. Did you write your script inside a spreadsheet or a Google Site ? If so, you have to open the spreadsheet or site to see your script.
If you indeed have a standalone script, make sure you click the 'All Items' on the left hand side of Google Drive or use search.
If you've created a new script from script.google.com and have saved it, it'll appear in Drive under the root My Drive folder.
If you created one from inside of Drive by clicking the red Create button then Script, it'll be in the folder which you last clicked on before clicking Create. If you don't remember what folder you created the script file under, click the Recent folder name to find it.
If you've started one inside a Form , Sheet, or Doc you'll have to remember where the Form, Sheet or Doc was located in Drive.
You can search all your scripts in Google Drive using app:"Google Apps Script" or by selecting Google Apps Script under Opens With from the drop down menu.
As pointed out by #Mandy, this assumes you have added Apps Script as a connect app. See answer from #Serge on how to do that.
Try the handy dashboard/central location for scripts:
https://script.google.com
The following script was recommended to use a List Page to show a Google Docs folder on a page in a google site.
https://developers.google.com/apps-script/articles/embedding_docslist_in_sites#section2
When I try to run it on a recently created folder in Google Drive, the script never seems to finish.
The script still works for a folder created before the switch to google drive, which has a much longer ID.
What am I missing?
Cheers
In the script gallery (open a spreadsheet, click on menu Tools>Script Gallery), search for "Embed Google Docs Folders in a Google Site".
This is an updated version of the script available in the Apps Script documentation. It should work better.