是否可以通过添加链接到脚本/宏的自定义图标来自定义谷歌电子表格/工作表的工具栏?我只看到过定制的电子表格菜单
目前还不可能。Spreadsheet
对象上的当前方法集不包括任何访问工具栏或添加新工具栏的工具。
您只能添加菜单、侧边栏或定义自定义函数。
我自己习惯于使用菜单项来切换侧边栏,方法大致如下:
function onOpen() {
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.createMenu('Custom Menu')
.addItem('Show sidebar', 'showSidebar')
.addToUi();
}
function showSidebar() {
var html = HtmlService.createHtmlOutputFromFile('Page')
.setTitle('My custom sidebar')
.setWidth(300);
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.showSidebar(html);
}
这是不可能的应用程序脚本,但你可以写一个浏览器扩展这样做。当然用户也需要安装它