Created
January 8, 2020 13:38
-
-
Save ochilab/55a549f2b5f45f6f63bc892da9d34df2 to your computer and use it in GitHub Desktop.
GASで重複チェックをしながらファイル名リストを保存する(種類をPDFファイルに限定)
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
var exist ={}; //重複チェックするための連想配列 | |
var pdfList=[]; | |
for(i in files){ | |
var tmp = files[i].getName(); | |
if(!exist[tmp]){ //重複してなければ | |
exist[tmp]=true; | |
//PDFファイルでかつファイルサイズが0以上のもの | |
if(files[i].getMimeType()=="application/pdf" && files[i].getSize()>0){ | |
pdfList.push(tmp); | |
} | |
} | |
} | |
Logger.log(pdfList); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment