从同一项目中的另一个文件运行 Google Apps 脚本

约翰尼杰克

我想从位于“Macro.gs”中的“测试”脚本中的“Generic Macros.gs”文件中运行脚本“xGen_FilterRemove”,如下所示,但我知道如何正确引用它?

function Test() {
  
    var aCurrentBook = SpreadsheetApp.getActive();
    'Generic Macros.gs'.xGen_FilterRemove()
      }
    };

在此处输入图像描述

库珀

像这样运行它

function Test() {
  var aCurrentBook = SpreadsheetApp.getActive();
  xGen_FilterRemove()
}

项目中的所有函数都可以通用访问,无论它们位于什么文件中。这就是为什么所有函数都必须具有唯一名称的原因。提供这些文件是为了更容易组织它们。您可以在一个文件中拥有任意数量的函数

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在另一个项目文件中调用Google Apps脚本

如何在PyCharm中运行包含同一项目中另一个脚本的脚本?(两个脚本都在PyCharm中)

使用 Google Apps 脚本的另一个附加组件 Google Docs

Google Apps脚本复制文件

如何从 Google Apps 脚本中的列表中获取唯一项目?

使用 Apps 脚本将部分从 Google Docs 复制到另一个 Doc

在Google Apps脚本中将整个工作表替换为另一个工作表

另一个 Google Apps 脚本 UrlFetchApp 返回未经授权的错误 401

Google Apps脚本-从另一个工作表导入工作表值

根据Google Apps脚本中的另一个数组过滤一个数组

备用Google Apps脚本未运行

公式更新后运行Google Apps脚本

在 Google Apps 脚本中运行多个函数

在Android中运行Google Apps脚本

Google Apps脚本:UrlFetchApp发布文件

使用 For 循环运行 Apps 脚本 - Google Sheets / Apps Script

Google Apps脚本要求

调用Google Apps脚本

Google Apps脚本-MailApp

Google Apps 脚本 indexOf

Google Apps脚本:onEdit

如何在另一个电子表格中使用Google Apps脚本?

从另一个匿名Web应用程序的Google Apps脚本Web应用程序获取JSON

在WorkBook中使用另一个电子表格中的= UNIQUE-Google Apps脚本

将工作表复制到另一个电子表格[Google Apps脚本]

从电子表格中修改另一个电子表格:Google Apps脚本

从一个单元格复制一个值并将其粘贴到另一个-Google Apps脚本

Google Apps脚本-隐藏“运行脚本”通知

在Google Apps脚本(JavaScript)中查找列表的唯一项