该网址未被识别为有效的Google脚本 [英] The url is not recognized as a valid Google Script

查看:76
本文介绍了该网址未被识别为有效的Google脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发布了一个应用脚本作为网络应用,当我使用网络应用的网址时,一切运行良好。



https://script.google.com/a / macros / [mydomain] / s / [servicekey] / exec



当我进入Google网站并尝试插入Google脚本小工具并选择网址我的网络应用程序不断收到一条消息,指出该网址未被识别为有效的Google脚本。但是,如果我在新的浏览器窗口中复制并通过网址,那么网络应用程序出现就好了。是不是可以将已发布的网页应用程序插入Google网站?



我甚至尝试使用旧的命名约定,如 here 但没有运气。 h2_lin>解决方案

脚本的原始容器是什么?你是从电子表格开发的吗?作为一个独立的脚本文件?或在你的网站脚本编辑器?
在网站托管时产生的webapp网址是不同的,下面是一个可以插入的例子:

 ` https://sites.google.com/macros/exec?service = keyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` 

请注意,如果一个脚本被托管在该站点中,因为该脚本可以直接通过其名称直接使用,所以该URL不是有用的。
我必须承认界面并不是真的很清楚,文档也不是这样,但这是我得出的结论,请不要认为这是绝对的事实;-)也许Google的某个人可以确认(或不是)。

编辑:您提到的'旧记法'仍然适用于我作为独立脚本文件开发的脚本,它使用与url结构关联的键如上图所示......我只是复制/粘贴了keyxxx ...所没有的其他密钥。


I published an App Script as a web app and everything runs fine when I use the web app URL.

https://script.google.com/a/macros/[mydomain]/s/[servicekey]/exec

When I go into a Google Site and try to insert a "Google Script Gadget" and select the URL of my web app I keep getting a message that says "The URL is not recognized as a valid Google Script". However, if I copy and past the URL in a new browser window the web app comes up just fine. Is it not possible to insert a published web app into a Google site?

I even tried using the old naming convention as described here but no luck.

解决方案

What is the original 'container' of your script ? did you develop it from a spreadsheet ? as a standalone script file ? or in you site script editor ? The resulting webapp urls are different when hosted in a site , here is an example that can be inserted :

`https://sites.google.com/macros/exec?service=keyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

note that if a script is hosted in the site this url is not useful since the script is available directly by its name. I must admit that the interface is not really clear about that, nor is the documentation but that's the conclusion I came to, please don't consider this as an absolute truth ;-) maybe someone from Google could confirm (or not).

EDIT : the 'old notation' that you mention is still working for me for a script developed as a standalone script file using the key associated to the url structure shown above... I just copied/pasted the key without anything else where the keyxxx... stands.

这篇关于该网址未被识别为有效的Google脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆