在Google Apps脚本中查看某个工作表时触发

问题描述 投票:0回答:1

当查看某个工作表时,Google 应用程序脚本中是否有触发器?请给出一些示例代码。预先感谢..

google-apps-script triggers
1个回答
0
投票

也许你可以在有人编辑时使用触发器和 getActiveSheet 方法。 比如:

let ss = SpreadsheetApp.getActiveSpreadsheet;
let sheet = 'stack questions';
let activeSheet = ss.getActiveSheet();
    if (activeSheet === sheet) {
    console.log(`The sheet ${sheet} is in use`):
    }
    else { console.log(`The sheet ${activeSheet} is the one in use`)}
© www.soinside.com 2019 - 2024. All rights reserved.