I've been switched over to the new Google Apps Script IDE.
If I have multiple .gs and html files in one script document I used to be able to make changes on a file a close that without saving. Now the tabs are no more and you click directly on the filename and all you can do is undo until the file is reverted.
Is there a way to revert in one step?
thanks
The new code editor has no way to close an unsaved files' edit session. There is no good way to revert back to the last saved content. The only option you have is to close or refresh the browser tab. If you close or refresh the browser tab and you have other unsaved open file sessions that you want saved, then make sure to save the ones you want.
Related
I would like to create a means of overriding the default filename generated by Gmail when saving an email as a PDF file. I have a specific naming convention I use. It is tedious to manually modify the default filename each time I want to print an email to PDF.
I would like to create a script that does the following:
Within Gmail, I open an email I want to print to PDF.
I click a button or select a menu entry to initiate my print to PDF script.
The script opens the 'Save As' dialog and populates the filename field following my naming convention.
I then take over and interact with the 'Save As' dialog to save the file to the location of my choice.
I have done some initial research, but I am not confident this is going to be easy to accomplish. I would like some feedback from experts as to the feasibility of my project.
Thank you.
As far as I understand the question: you are not trying to interact at the Gmail web application level, but at the browser.
You can check for yourself when you use Gmail: before trying to save your attachment you can open the console (pressing F12) but as soon as you enter in a "save as" menu either you can't open it, or it will be dimmed.
This, again AFAIU, prevents you from acting even at the extension level, because you would not be able to press an extension button while the save dialog is open.
Unless you want to dig into the inner workings of your browser, I would recommend going the route of checking automation scripts for your operating system.
You could create a hot key on your pc that keys in the characters that respect your file format and, as soon as they are keyed in, you would then be able to modify the file name and press Enter.
please help, I accidentally removed a huge portion of my codes in Google Script and accidentally saved it. Is there any way I can "Undo" and I get my previous version back?
Try this:
In the script editor, click Use legacy editor.
In the left-hand pane, click the name of the script file you want to restore.
Choose File > See version history.
Select the version you want to restore.
Click Restore.
Alternatively, use the revision history list to copy the code of the version you want to keep and paste it elsewhere.
To return to the new Monaco editor, click Use new editor.
I am creating an invoice tool within Google Sheets. The way it works is that after all the data is entered, a script is running, creating a sheet with the actual layed-out invoice.
I know that there is a way to automatically export sheets as PDF (by calling the document url with the "export?exportFormat=pdf" argument). But I don't want to export directly, I just need the "Print" dialog (File->Print) to pop up automatically so the user can adjust the settings before printing. (I know, it's not a big deal to press cmd+P yourself, but having the dialog open automatically would streamline the whole process a bit).
Is there any way to do that? I haven't found anything helpful within the documentation.
There isn't a way to do that with Google Apps Script services but you might do that by using client side code.
Related
JavaScript print preview
I made a copy of a Google Apps Script project by mistake by choosing File > Make a copy... on Script Editor and since then every time I click Tools > Script Editor... on the Spreadsheet screen the project belongs to, I see a screen showing the two projects (original one and copied one) and I need to choose one to open the script editor. To be worse, the original script became unexecutable since I made the copy, I don't know if this is the cause of that though.
So, I'd like to remove the copy project from the Spreadsheet. How can I do that? I can't find any menu to remove project.
Thanks,
Open the "copy of" version of the script, click File -> Delete Project... This will generate a confirmation box. Click the Delete button to confirm that you would like to delete the project. This should leave your original as the only associated script.
So I'm about to attempt to upload several files through a Google Chrome Extension.
Instead of pressing the Upload button on the webpage and load each file one by one I want to automate it.
How should I go about this? Is it as simple as detecting the script inside the DOM responsible with uploading, changing the file_to_upload string from the scipt with a filename on my computer and injecting the new script and execute it ?