GAS googleドライブで使用できる容量の上限を取得する
- 作成日 2022.12.01
- Google Apps Script
- Google Apps Script

GAS(Google Apps Script)で、googleドライブで使用できる容量の上限を取得する手順を記述してます。「getStorageLimit」で可能です。戻り値は、バイト単位で返ってきます。
環境
- OS windows11 home
- ブラウザ chrome 107.0.5304.122
使用できる容量の上限を取得
使用できる容量の上限を取得するには、「getStorageLimit」を使用します。
DriveApp.getStorageLimit()
実際に、取得してみます。
function myFunction() {
const storageLimit = DriveApp.getStorageLimit();
console.log(storageLimit + 'B'); //Byte単位
console.log(storageLimit / 1024 + 'KB'); //KB単位
console.log(storageLimit / ( 1024 ** 2 ) + 'MB'); //MB単位
console.log(storageLimit / ( 1024 ** 3 ) + 'GB'); //GB単位
}
実行結果を見ると取得されていることが確認できます。

-
前の記事
sakuraエディタ ファイルを閉じてファイルを開くショートカットキー 2022.12.01
-
次の記事
mac 大きな文字を出力する 2022.12.01
コメントを書く