It is not permitted to call Browser.inputBox() from this context

后端 未结 1 807
天命终不由人
天命终不由人 2021-01-26 12:26

In my first experiences with Google Scripts, I\'m trying to define a function that call a Browser.input method to get a user name. But I always get the following error message:<

1条回答
  •  有刺的猬
    2021-01-26 13:04

    Browser.inputBox() can only be used from a script running from a spreadsheet. Once you use a Ui (with UiApp or GUI builder or HTML service) you can't use these Browser methods. The only situation in wich they can be combined is when you show(app) from a spreadsheet script but then the Browser call will close the UI immediately.

    This seems quite logical since they are in a way Ui themselves...

    By the way, you say in your comment that you are updating your question with some code but I see nothing ? Is it normal ?


    EDIT : to answer your comment, there are many ways to interact with users... something that is quite similar to Browser.message is the popup example proposed by Waqar Ahmad recently. As for your second point : where to find such information... well I guess I've read about everything that can be read on the subject for quite a moment now.... I'm not sure where that particular aspect is described, sorry about that. If you read Google documentation about Ui I'm pretty sure you'll find something about that. (maybe someone from the team could help me on that point ? ;-)

    0 讨论(0)
提交回复
热议问题