[英]How can I create a shortcut in Drive that redirects to a specific url
I've been unsuccessfully trying to create a short cut in Drive that once you click on it, you get redirected to a specific url. 我一直没有尝试在Drive中创建快捷方式,一旦单击它,您就会被重定向到特定的网址。
Do you have an idea on how I might do that? 您是否知道我该怎么做?
Here is the code I started with : 这是我开始的代码:
drive_service = build('drive', 'v2', http=http)
# Insert a shortcut
body = {
'title': 'shortcut',
'description': 'description',
'mimetype': 'application/vnd.google-apps.drive-sdk',
}
file = drive_service.files().insert(body=body).execute()
It created the file but when I click on it in Drive it redirects me here: 它创建了文件,但是当我在云端硬盘中单击它时,它会将我重定向到此处:
'https://docs.google.com/file/d/{File ID}/edit'
You cant create a shortcut file unless is a custom file that opens by default by your previously-installed drive app. 除非是以前安装的驱动器应用程序默认打开的自定义文件,否则您无法创建快捷方式文件。
Else you could create the html for the anchor and use that as the html content for agoogle doc. 否则,您可以为锚创建html并将其用作agoogle doc的html内容。 See the official docs on how to do that, basically you create a new google doc with that html and specify convert=true. 有关如何执行此操作的信息,请参见官方文档,基本上,您可以使用该html创建一个新的google文档,并指定convert = true。
When the user opens the gdoc, she will need two more clicks to navigate to the url. 当用户打开gdoc时,她将需要再单击两次以导航到该url。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.