This may be a very dumb question but I’ve exhausted every search I can think of.
I have a large set of data in a Google sheet that I run 3 separate scripts(1 tethered/2 standalone) on that pull data from the sheet and output to Google Docs after we finish a job(packing Slip, Shipment notification, etc.)
I link a template Google Doc that includes the required formatting for each needed document and defines the data I want to include: Shipped to: {Client Address}
I link my Google Sheet and say where I want the data pulled from. {Client Address} = defined cell
Defined cell = “Joe Blow”
I link a blank Google Doc where the information is output: {Client Adress} becomes defined cell’s contents.
I then do some text replacement: “Joe Blow” = “111 Sycamore Ave”
In the end, I’m left with: Shipped to: 111 Sycamore Ave
All 3 do the same basic function, using different template docs and text replacements.
I’ve always run the 3 scripts from separate Google scripts projects because whenever I’ve tried to create multiple .gs files within my main tethered script project and use the file selection or the dropdown menu, the 3 individual scripts break each other and usually only 1 will work.
How do I make each of my 3 scripts completely ignore each other when they are in different .gs files within the same tethered script?
I am entirely self-taught and cobbled these scripts together by searching forums like this. They’ve worked for us and saved us a ton of time. I’d like to save more by not having to open three separate tabs every time I finish a job.
I’ve tried utilizing libraries and class but only have a basic understanding of what those are used for.
2
Briefly, when putting together multiple scripts in an Apps Script project, whether using one or multiple files, please ensure that the variable and function names at the top level are unique.
Related
- Function Scope Rules (Google Apps Script Project)
1