3

I am building an application with a Google App Script project that will be entirely housed within Google Sheets. I am using different tabs of a sheet for data storage and building HTML-based dialogs and sidebars to navigate the application. I am not going to deploy this as a library or web app, and I am not planning on utilizing any other web server of my own creation.

It is going well so far, but at this point I would like to added embedded resources, e.g. images that can be used as backgrounds of web pages. I can add .gs files and .html files fine to cover server-side coding, client-side coding, and styles, but I do not know of a way to add other files to the project. If this were a conventional web-based development process, I imagine I'd have something like an "img" folder at the root of my server entry point -- that's the functionality I am looking for in a GAS project.

Is it possible to add embedded resource files to a GAS project? Alternately, is there some way I can encode binary resources in an HTML file and then decode as needed to appear as usable content? I can certainly build adequate data-entry forms without additional resources, but things are going to look pretty spartan.

I did find a previous question that mentioned workarounds like placing resources in Google Drive alongside the Google Sheet w/ script, but that was from 4 years ago. Was wondering if there was a better/preferred methodology now that I am simply missing. That other question can be viewed here:

Elegant way to store resources...

halfer
  • 19,824
  • 17
  • 99
  • 186
sutekh137
  • 681
  • 1
  • 6
  • 18
  • The question is too broad, by the other hand it mention a related question but doesn't include the link to it. – Rubén Nov 16 '16 at 19:56
  • I have added a link to the other question -- sorry about that. The other question is essentially the same as mine, and no one marked it down for being too broad. What gives? And it is true the other question was asked more than four years ago. Is there no facility for re-asking a similar question when new capabilities may have been introduced to the environment in question? – sutekh137 Nov 16 '16 at 22:02
  • How do you know that the other question doesn't have downvotes and/or closing votes if the voters don't post a comment about that? Regarding re-asking a question checkout http://meta.stackoverflow.com/q/333443/1595451 – Rubén Nov 16 '16 at 22:39
  • 1
    You are correct in that I can't know if that other question had down-votes. All I know is that it is at a 4 (in total) while my question was at -1 when I mentioned it (and I'm not expecting all that many more views). The comments on that other question also carry a tone that indicates the question was worthwhile (even worthy of making a feature request) while my question was dismissed as "too broad". Apparently I have more research to do on how to ask questions correctly before I can be enlightened, so thanks for the link about re-asking -- going to read that now. – sutekh137 Nov 16 '16 at 22:55
  • Thanks again, @Rubén for the link about re-asking a question. My interpretation of that assessment is that this was a fine situation to re-ask instead of posting on the old question, offering a bounty, or simply not asking the question at all. I think it is safe to say that four years passing makes current GAS methodology into a new "version" of sorts, a version that might very well have new advancements in this area (though does not appear to at this point). – sutekh137 Nov 17 '16 at 15:18

1 Answers1

0

Partial answer

If this were a conventional web-based development process, I imagine I'd have something like an "img" folder at the root of my server entry point -- that's the functionality I am looking for in a GAS project.

Google Apps Script doesn't have a root folder. Non-code resources should be hosted somewhere else.

See also

http://www.google.com/script/start

Community
  • 1
  • 1
Rubén
  • 34,714
  • 9
  • 70
  • 166
  • I am well aware that GAS does not have a concept of a "root" folder. But it does have the facility to include other files in the project, by name, so it is not entirely silly to think resource files could at some point be items that could be added to a project and referenced by name. (Note: I do not know whether the questioner from that other thread ever did in fact file a feature request...) – sutekh137 Nov 16 '16 at 22:08
  • You can create your own file/folder structure locally if you use clasp. They will still be flat in Google Scripts, but will push/pull to the directories you specify. So with that you can sort of create a folder structure. However, to the original question, it seems no matter what, clasp will only include certain file extensions. Image files are never included in push requests. – Trashman Feb 04 '22 at 21:39