简体   繁体   中英

Run a Google Apps Script from another file within the same project

I would like to run the script "xGen_FilterRemove" from my "Generic Macros.gs" file in my "Test" Script located in "Macro.gs" as per below, but am know sure how to correctly reference it?

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

在此处输入图像描述

Just run it like this

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

All of the functions in a project are accessible universally no matter what file they are in. That's why all functions must have a unique name. The files are provided to make it easier to organize them. You can have as many functions in a file as you wish

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM