简体   繁体   English

在Google Apps脚本中调用Google表格插件?

[英]Call a Google Sheets add-on within a Google Apps Script?

Is it possible to call a Google Sheets add-on as if it were a function in an Apps Script? 是否可以像Google Apps脚本中的函数一样调用Google表格插件?

I am trying to automate a few steps like this: 我试图自动化这样的几个步骤:

  1. Import/append data from sheet 1 to main sheet 1 将数据从工作表1导入/追加到主工作表1
  2. Import/append data from sheet 2 to main sheet 2 将数据从工作表2导入/追加到主工作表2
  3. Merge values/append new values from main sheets 1 and 2 into main sheet 3 合并值/将新值从主表1和2追加到主表3中

All of these steps are done with 2 add-ons. 所有这些步骤都是通过2个附加组件完成的。 Ideally, I could call those add-on functions with a script and run the script with a button. 理想情况下,我可以使用脚本调用这些附加功能,然后使用按钮运行脚本。

Is this possible? 这可能吗?

Short answer 简短答案

AFAIK it's not possible. AFAIK这是不可能的。

Explanation 说明

Google Apps Script official documentation doesn't include this on the Guides section, by the other hand, there aren't a documented way to call add-on functions other than the custom menus and the add-on dialogs, sidebars, custom functions and triggers. 另一方面,Google Apps Script的官方文档并未在“指南”部分中提供此功能,除了自定义菜单和附加对话框,侧边栏,自定义功能以及触发。

This is possible however all users have to have view permission to the underlining script file that you publish from. 这是可能的,但是所有用户都必须具有从中发布下划线脚本文件的查看权限。

I'm not sure this is bullet proof but to help limit the exposure of the code I've: 我不确定这是否是防弹的,但为了帮助限制公开代码的作用:

1) Share code with option "Anyone at My Domain with the link" 1)使用“链接中的“我的域中的任何人””选项共享代码

  • only my domain users can access it (not everyone on the web) 只有我的域用户可以访问它(不是网络上的所有人)
  • make it a little harder to find (so they can't search for it) 使其更难找到(因此他们无法搜索)

2) Break off any function you don't want users to potentially see into a seperate Library ; 2)将您不希望用户看到的任何功能分解到单独的库中 make this Library private 将此图书馆设为私有

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 部署和使用带有Google Apps脚本的Google表格插件 - Deploy and use Google Sheets add-on with Google Apps Script 如何从加载项加载Google Apps脚本UDF以在Google表格中使用? - How to does one load Google Apps Script UDFs for use in Google Sheets from an Add-on? Google Apps 脚本“不受支持的插件” - Google Apps Script "Unsupported add-on" 是否可以为任何有链接的人都可以安装的 Google 表格发布私有 Apps 脚本插件? - Is it possible to publish a private Apps Script add-on for Google Sheets that anyone with a link can install? 将其他加载项用于Google Apps脚本Google文档 - Use another Add-On for Google Apps Script Google Docs 使用 Google Apps 脚本为 Google 插件设置触发器 - Setting up a trigger for a Google add-on using Google Apps Script 如何在 Google Apps 脚本插件中的点击事件中获取卡片服务元素的价值? - How to get value of Card Service elements in click event within Google Apps Script add-on? GMail加载项/应用程序脚本无法连接到Google Cloud SQL-调用getCloudSqlConnection的权限 - GMail Add-On / Apps script can't connect to Google Cloud SQL - permission to call getCloudSqlConnection Google表格附加脚本中的累积正态分布函数 - Cumulative Normal Distribution function in Add-On Script in Google Sheets 在新的脚本编辑器中为 Google 表格创建和测试插件 - Creating and testing an add-on for Google Sheets in the new Script Editor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM