■ソースコード
			TAB = String.fromCharCode(9);
			filename = File.openDialog("データファイルを選択してください","");
			fileObj = new File(filename);
			if (fileObj.open("r"))
			{
			 compNameData = new Array();
			 repNameData = new Array();
			 count = 0;
			 while(!fileObj.eof)
			 {
			  txt = fileObj.readln();
			  compNameData[count] = txt.split(TAB)[0];
			  repNameData[count] = txt.split(TAB)[1];
			  count++;
			 }
			 for (i=1; i<=app.project.items.length; i++)
			 {
			  iName = app.project.item(i).name;
			  alert(iName);
			  for (var j=0; j<count; j++)
			  {
			   if (iName == compNameData[j])
			   {
			    repFile = new File(repNameData[j]);
			    app.project.item(i).replace(repFile);
			   }
			  }
			 }
			}
■data.txtファイル(タブ区切りファイル)
			#1 /images/001.psd
			#2 /images/002.psd
			#3 /images/003.psd
■使い方
			 フッテージを置換するプロジェクトを開きます。スクリプトを実行すると該当する名前のフッテージがある場合のみ置換されます。
			
			
			 
サンプルをダウンロード
目次へ戻る