Search code examples
javascripthtmlgoogle-apps-scriptweb-applications

Creating a Google Script App pop-up that is not document bound


There are a few solutions for creating pop-ups bound to Google documents but I haven't found a solution that I can just put in a stand-alone google script app without creating a google document nor separate HTML document for it. (Correction, I think there was an old way that is deprecated now UiApp.createApplication())

I am thinking about creating a handful of apps that I'd like to use regularly without creating an HTML GUI interface. The Google script will be searching my google drive folder for items and organizing my drive so i wanted just a quick and simple (if even dirty) way of popping up a message if a folder doesn't exist.

myFunction() {
  alert("File does not exist");
}

Logger.log() is not equivalent but if someone knows of a way to have that popup automatically without the Ctrl+Enter hotkey, then that would be good enough for now.

Thanks.


Solution

  • Just throw a new ERROR:

    function myFunction() {
      throw new Error("File does not exist");
    }