const folderId = `××××××××××××××××××××××××××××`;
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const targetSheet = spreadsheet.getSheetByName('依頼書');
const targetSheetName = targetSheet.getSheetName();
const activeSheet = spreadsheet.getActiveSheet();
const activeSheetName = activeSheet.getSheetName()
if (targetSheetName !== activeSheetName) { return };
console.log(`指定したシート: ${targetSheetName}`);
console.log(`アクティブなシート: ${activeSheetName}`);
const activeCell = targetSheet.getActiveCell();
if (activeCell.getA1Notation() !== `L3`) {
console.log(`セル位置相違`); return
let question = Browser.msgBox(`この内容で発行しますか?`,Browser.Buttons.OK_CANCEL);
const ss = SpreadsheetApp.getActiveSpreadsheet();
const title = ss.getRange(`B6`).getValue();
const number = ss.getRange(`L3`).getValue();
const sheetId = ss.getSheetByName('依頼書').getSheetId();
const options = 'exportFormat=pdf&format=pdf'
const requestUrl = url + options;
const token = ScriptApp.getOAuthToken();
'headers': { 'Authorization': 'Bearer ' + token },
'muteHttpExceptions': true
const response = UrlFetchApp.fetch(requestUrl, params);
const blob = response.getBlob();
blob.setName(title + ` 番号:` + number + '.pdf');
const folder = DriveApp.getFolderById(folderId);