I am trying to copy this source http://pastebin.com/s7v5x4jk to a file a in a Google Script project for a spreadsheet. The problem is that not all the text gets copied when I do a copy and paste. Is there a way to upload files to Script Projects or to get around this?
How to replicate:
Open a Google Spreadsheet, go to Tools->Script Editor and create a new project, try to copy all the text to the file.
You've got one very long line, perhaps that's overwhelming the editor. (There are 132000+ characters in line 10.)
You will able to paste the code into an Apps Script file by putting it through a prettifier first. A better alternative would be to use the development version, which isn't minified.
Related
I'm quite new to Apps Script, so please bear with me. I wrote a script that from a sheet creates a simple folder structure and then adds an editor. Everything works, but how can I edit text in the share invite? Preferably from a variable read from the sheet?
my two lines:
masterClientFolder.addFolder(clientFolder);
clientFolder.addEditor(projUser);
I'm wondering if there is a way to share a link to a Google Apps Script file that forces users to make a copy of it? Using Google Docs, you can append /copy to the url. For example:
https://docs.google.com/document/d/19yoQ71RcqNsYgPmZHzw96G_QH05hC20sWxk_ktahpXY/copy
This will force users to make a copy of the original document. I've been trying to do something similiar with a Google Apps Script file.
I've tried appending copy to the URL like this but it doesn't seem to work. As a potential work around, I could just use embedded scripts and share the Sheet/Doc/Form.
Anyone know of a URL parameter to force copying of a Google Apps Script file?
You can use this format to quickly make a copy of any public Google Script.
https://script.google.com/d/SCRIPT_ID/edit?newcopy=true
See example.
There is no way to do this since the new editor has been rolled, have reported it on this issue:
https://issuetracker.google.com/issues/198266388
You can manually make a copy on the new editor by going to the "Overview" tab, and on the top-right is the button to make a copy.
I have an html dialog for Sheets (container bound dialog) that is used for input and saving of customer data. I made a copy of it for use in a different office, so now I have Worksheet#1 with Script project "Scripts" and Copy of Worksheet#1 with Script project "Copy of Scripts". We've made changes to Scripts so it is no longer the same as Copy of Scripts.
Sometimes Worksheet#1 triggers scripts that are in Copy of Scripts. Not sure why. On these occasions I can open up script editor and it asks which project to open (Scripts or Copy or Scripts) and once I select the right one it behaves properly until the next time this happens.
How can I insure that it always opens the correct project?
You will see this behavior sometimes if you have multiple projects within a script.
Check whether you have multiple projects in one of those sheets.
File > Open...
Here's a spreadsheet-contained script with two projects in it:
Open the project you want to delete.
Delete it.
File > Delete Project...
I know how to write script to make a copy of an active spreadsheet (with my script, the spreadsheet is actually open on my screen) and save the copy with a filename name I give it to the folder I specify.
This is nice, but the spreadsheet open on my screen remains the original. I would like to know how to write a script to do as I describe above and close the original and open the copy on my screen. That is, I want the script to act as Microsoft Word and many other programs act - when you're working on a file and then click "save as".
Thank you!!!
The only way that you could open the newly created spreadsheet file, would be to have some kind of HTML user interface (Dialog, Sidebar, HTML App) that used something like window.top.location.href = url to open the new spreadsheet. There is no way to open and close Google files from Apps Script server side code.
I am trying to paste the sample code from the Google script tutorial into the script editor as instructed - but the code does not get transferred. I highlight the sample code, right click & select copy, position on the Google script editor, remove the existing code as instructed, right click and paste and nothing gets transferred.
To prove that the copy worked I pasted successfully into Notepad. Any ideas? I have windows 7 & IE11.
Help!
Some fields are designed to not accept paste data, you see that allot on register forms where you are forced to type in your email and password manually, maybe something like this is happening there.