dA-tools.com

File obj

Text fileを読み込んで表示。(改行有り)
var fileName = File.openDialog("Select Text file","");
var myFile = new File(fileName);
if (myFile.open("r")){var myText = "";while(!myFile.eof){myText = myText + myFile.readln() + String.fromCharCode(13);}app.project.item(1).layers.addText(myText);
}
Text fileに保存する
var myText="This is a Pen!";
var fileName= "saveTest.txt";
var outFile = filePutDialog(" Save", fileName, "TEXT txt");
if (outFile ){outFile.open("w");outFile.writeln(myText);outFile.close();
}