【发布时间】:2021-09-05 14:32:31
【问题描述】:
我正在尝试编写一个脚本来将绘图(通过单元格)移动到特定位置。 我在我的谷歌表上尝试了这种方法,但没有奏效: In Google Sheets how can I write a script to move each drawing to a specific location on the sheet?
你知道为什么吗?
我试过的代码:
const obj = {
"10": {name: " Drawing1 ", moveTo: [1,1]},
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("sheet1");
sheet.getDrawings().forEach(d => {
const arow = d.getContainerInfo().getAnchorRow();
if (arow in obj) {
d.setPosition(...obj[arow].moveTo, 0, 0);
}
})
【问题讨论】:
标签: google-apps-script google-sheets google-sheets-api