function thisButtonIsDumb() {
var sheet = SpreadsheetApp.getActive().getSheetByName('Class');
var range1 = sheet.getRange("8:8")
var class = sheet.getRange('Traits!L3').getValue();
if (class == "Warlock") {
sheet.getRange("10:10").setWrapStrategy(SpreadsheetApp.WrapStrategy.CLIP);
} else {
range1.setWrapStrategy(SpreadsheetApp.WrapStrategy.CLIP);
}
if (class == "Warlock") {
sheet.setRowHeight(10,21);
} else {
sheet.setRowHeight(8,21)
}
}
目前,thisButtonIsDumb 没有获取脚本,所以它不能运行脚本。它说“找不到脚本函数 thisButtonIsDumb”。它没有连接,我不知道为什么。
最佳答案
要将脚本分配给按钮,您必须:
- 右键点击按钮
- 分配脚本
- 设置不带 () 的函数名 -> thisButtonIsDumb
关于javascript - 如何让按钮拾取功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59439579/