function onOpen() is not running

前端 未结 5 478
谎友^
谎友^ 2020-12-31 03:10

My function includes adding a menu and toast to the document. I have verified that the trigger (onOpen) is set as well. It only works when a user goes into Tools, Script Man

5条回答
  •  我在风中等你
    2020-12-31 03:35

    I was having the same issue.

    I realized, sometimes Google create some kind of cache of the scripts (I'm used to have a "test" script and I usually alter it's content, and, sometimes, the script runs as if I didn't).

    So, what I did that solved the onOpen() not working was changing the function name and ading a trigger manually.

    Go to Current script's triggers…"">

    Go to "Resources -> Current script's triggers…"

    Choose the function to run on open

    Choose the function to run on open

    It worked like a charm here!

    Updated Location Information: or

    Then

提交回复
热议问题