function onEdit(e) {
var checkBoxLocation = 'D1';
var checkBoxCondition = true;
var SPREADSHEET_ID = 'ключ таблицы';
var SHEET_NAME = 'Лист1';
var dataSheet = SpreadsheetApp.openById(SPREADSHEET_ID).getSheetByName(SHEET_NAME);
var getA = sheet.getRange(rowIndex,1).getValue();
var getB = sheet.getRange(rowIndex,2).getValue();
var lastRow = dataSheet.getLastRow()+1;
if (e.range.getA1Notation() == checkBoxLocation) {
if (e.range.getValue() == checkBoxCondition) {
dataSheet.getRange('A' + lastRow).setValue(getA);
dataSheet.getRange('C' + lastRow).setValue(getB);
}
else {
//cell.setValue("A1 checkbox is unticked");
}
}
}