Google Apps Script googleドライブ内のフォルダの名前を取得するサンプル

環境
Google Chrome  122.0.6261.129(Official Build) (64 ビット)
Windows 11 Pro 64bit

構文
folder.getName()
フォルダの名前を取得するには、「getName」を使用します。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function myFunction() {
// idから取得
let f = DriveApp.getFolderById('xxx');
// 名前を取得
console.log(f.getName());
}
function myFunction() { // idから取得 let f = DriveApp.getFolderById('xxx'); // 名前を取得 console.log(f.getName()); }
function myFunction() {

  // idから取得
  let f = DriveApp.getFolderById('xxx');

  // 名前を取得
  console.log(f.getName());

}

 

Google Apps Script

Posted by arkgame