I'm new to Google apps script.
I can create a number of documents in Google Drive via a script and add content.
I would also like to publish them via a script and record the published URL. Is this possible?
I can see an old answer from 2012
"Publish to the web" for Document in Google Apps Script?
You can create all your content in a publicly shared folder, then once you have the folder's ID, you can create a straightforward base URL (e.g. https://googledrive.com/host/[folder ID]/) and simply append the newly created file names. I asked a question related to this topic a few days ago.
Conversely, you can set the permissions for each file you create then get the download URL's for them individually using getDownloadUrl().
Related
I would like to allow my students to send me one or more files directly to my google drive via a form where they would just enter their name and choose the file(s) to send (drag and drop would be great). A folder with their name would be created in a specific folder on my drive and a warning email would be sent to me. Do you think this is feasible with google script? Thanks in advance.
An example here but paying ...
I've checked and Google Forms already allows for a File Upload kind of question (with drag and drop too).
It automatically creates a folder in your Google Drive (altough it doesnt create a folder for every student) (example here) and in the spreadsheet that it automatically generates there is a permanent link to that file (example here).
If that's not what you are looking for and you need the 'Folder per student' feature then yes, you can use google apps script to move files in folders quite easily.
I am collecting Friends photos through a Google Form. The Form has only two fields Name (text) and Photo (upload).
The uploaded photo is stored in a folder in Google Drive and a hyperlink appears in the Google sheet to the name.
The issue I am facing is that the photo stored in Google Drive usually has a name generated while taking the photo and is not the name of the person whose photo it is. I want the photo file name to be the same as the person's name.
I don't know much of Google Scripts and would like help in using a script to rename the files in the Google Drive with the name of the uploader which is in the Google Sheet.
To rename uploaded files in Google Drive that have been collected through Google Forms you can
create your own apps script that will process all files received via Google Form, as described here or here, or
use my Google Forms add-on Form Uploads Manager that renames the uploaded files, move them to the Google Drive folders you specified and can add a description for each uploaded file, which makes it easy to find files using the built-in Google Drive search. A detailed description of the add-on settings is available on the app home page.
Disclaimer: This is my Google Forms add-on, which I created for my own purposes, and after successful use I posted it on the Google Workspace Marketplace. After a 1 week trial (which might be enough to reach your goals), a paid add-on subscription is required.
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
What I want to do
Copy a google sheet programmatically via API.
Change the copied sheet's cloud platform project to the original sheets project, when copied Google creates a new google platform project, that's not what I want.
Get the script id of the copied sheet.
All of the above only programmatically, I already know how to do these things manually by clicking menu's.
What I have already tried:
This google documentation article tells me how to change a platform project manually, I want to do the same thing via some API that Google may be providing.
You can copy a sheet programmatically via this API, however you can't get the associated script id or the project and it doesn't let me set the cloud platform project.
I know how to get the script id from within the sheet, I want to do this from outside the sheet.
Note that the API's I need have to be accessible via outside the sheet, via a program that I host myself.
I realized what I was really looking for were Add on's. Via that I can keep the apps script project as one which solves all my requirements.
Read more about App Script addons from this google doc page: https://developers.google.com/apps-script/add-ons/
When a user downloads a CSV file from an arbitrary site, I would like to be informed of this event and automatically upload the same file as a Google Sheets file. Is this possible or would this be violating a fundamental browser security concept?
The CSV file in question does not have a URL, but is created on the fly by the arbitrary web site, when the user clicks a button. An example would be the user's list of financial transactions at a bank web site.
I am not new to Google Apps/Drive but I am new to Google Apps Script.
There is no way to detect that kind of events.
I can't even imagine a function that would allow for automatic file upload of a local file... don't forget Google Apps Script is a server based environment.