Skip to content

Instantly share code, notes, and snippets.

@tanaikech
Last active January 15, 2017 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanaikech/0751dd42c14d6deac9b46126cca7221a to your computer and use it in GitHub Desktop.
Save tanaikech/0751dd42c14d6deac9b46126cca7221a to your computer and use it in GitHub Desktop.
Google Apps Scriptでファイル名、フォルダ名からファイルへアクセスしたい ref: http://qiita.com/tanaike/items/94c263d3906ee23ad522
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