Skip to content

Instantly share code, notes, and snippets.

@tokyosheep
Created July 7, 2019 22:40
Show Gist options
  • Select an option

  • Save tokyosheep/0429fbbcb91a3005012c7fee02af4e56 to your computer and use it in GitHub Desktop.

Select an option

Save tokyosheep/0429fbbcb91a3005012c7fee02af4e56 to your computer and use it in GitHub Desktop.
//this.fileList フォルダダイアログから取得した画像ファイル
//this.images すでにillustratorに配置されている画像ファイル
if(!this.fileList){
return;
}
for(var i=0;i<this.images.length;i++){
for(var j=0;j<this.fileList.length;j++){
var flag = isNameSame(this.images[i].file.name,this.fileList[j]);
if(flag){
this.images[i].file = new File (this.fileList[j]);//置き換え
}
}
}
function isNameSame(reName,Folname){//ファイル名が同じか確認
var name1 = decodeURI(reName);
var name2 = new File(Folname);
return name1 === name2.name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment