Output Arabic/Thai text in Excel file using Photoshop JavaScript

梦想与她 提交于 2019-12-04 15:49:16

You need to set your text to Unicode. In the example below I'll write the layer name to a text file. The principal is the same for CSV.

// refer to the source document
var srcDoc = app.activeDocument;

var myLayerName = srcDoc.activeLayer.name; // ملعقة
alert(myLayerName) // alerts fine;

write_text(myLayerName, "C:\\temp\\layer_name.txt");


function write_text(str, apath)
{
  // create a reference to a file for output
  var txtFile = new File(apath);

  // open the file, write the data, then close the file
  txtFile.encoding = "UTF8"; // make it unicode
  txtFile.open("w", "TEXT", "????");
  txtFile.writeln(str);
  txtFile.close();
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!