0
votes

I am developing a one of those bulk delete script for gmail. I want to create a front end for the script so I can easily modify my settings on a per-label basis to specify how many emails I want to delete during a trigger event and how old they have to be for a particular label. I want to be able to test the interface similar to testing a script.....just hit the run button. However, google's script engine tells me I need to deploy the script and it's HTML files as a web app to test the interface.

Is there anyway to test the the interface and its interaction with my backend google script without deploying as a web app?

1
How /why does it make a problem to deploy it? - Serge insas
Apart from the HTML service, you can also use the UiApp to build a user interface (you still have to deploy as a web app). But as Serge asks, why are you hesitant to create a web app - Srik
@Sergeinsas, Sorry I haven't been on this site in a while. I want to be able to edit some code and just hit the refresh button in my web browser like you would do if running a web server on your own machine. Its just a speed and convience thing when testing my code. - Talguy
@Talguy To "deploy a webapp" using the method I suggested in my answer is by far the fastest way to test your code. For example, if you have buttons and handlers that call functions, you can change the code in the script file, save the code, then press the button and all your changes will be visible to the rendered version, even without having to refresh. There are some situations, like building panels where you need to refresh though. See my update to my answer to see how to disable it after you're done. If you think my answer suffices, be sure to accept it! - Chris Cirefice

1 Answers

3
votes

The answer is no, unless you "deploy" your code through a Spreadsheet. In fact, it's fairly well-documented.

See Serve HTML as a Google Docs, Sheets, or Forms user interface on that page for a "workaround" to testing your app without actually deploying it.

However, there is no harm in deploying it as a webapp. And as a matter of fact, you can see changes instantly after refreshing your app that you have deployed (published), using the dev macro you're given when you deploy it. This is the most useful tool for UiApp and HTMLService:

enter image description here

Edit: After you're done testing and you've "finalized" your code, you can disable the webapp, meaning that nobody can accidentally access it, you don't post the macro link to it, etc. It's a one-click process. Again, this is really the only way to test the code in my opinion, as it's most succinct for a real "development process". See image below:

enter image description here