Last active
January 15, 2017 22:30
-
-
Save tanaikech/0751dd42c14d6deac9b46126cca7221a to your computer and use it in GitHub Desktop.
Google Apps Scriptでファイル名、フォルダ名からファイルへアクセスしたい ref: http://qiita.com/tanaike/items/94c263d3906ee23ad522
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function F_number(file_name, folder_name) { | |
var Array_files = []; | |
var Array_folders = []; | |
var fileIT = DriveApp.getFilesByName(file_name); | |
while (fileIT.hasNext()) { | |
Array_files.push(fileIT.next().getId()); | |
}; | |
var folderIT = DriveApp.getFoldersByName(folder_name); | |
while (folderIT.hasNext()) { | |
Array_folders.push(folderIT.next().getId()); | |
}; | |
return [Array_files.length, Array_folders.length]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment