Skip to content

Instantly share code, notes, and snippets.

@ochilab
Created January 8, 2020 13:38
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 ochilab/55a549f2b5f45f6f63bc892da9d34df2 to your computer and use it in GitHub Desktop.
Save ochilab/55a549f2b5f45f6f63bc892da9d34df2 to your computer and use it in GitHub Desktop.
GASで重複チェックをしながらファイル名リストを保存する(種類をPDFファイルに限定)
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