function textWriter(filepath, str){
var fileObj = new File(filepath);
fileObj.open("a");
fileObj.encoding = "UTF-8";
fileObj.lineFeed = "Unix"; //改行コードLF
fileObj.writeln(str);
fileObj.close();
fileObj = null;
}