Extendscript Toolkit targeting Bridge, does'nt read text file content. Bug?
When I load a file xml and read its contents, it only works from Bridge on windows7
But when I run the code to Bridge from Abobe Extendscript Toolkit targeting Bridge, it does'nt read the fole content ( fileXMLtoParse.read() )
Is this a bug, or there is a work arround?
My example code that reads a xml fole from Desktop:
XML (Desktop/userCheckin.xml)
<preferences>
<editor>Content to read here</editor>
</preferences>
Code:
var userDisk = Folder("~/Desktop");
var xmlFile = File(userDisk + "/userCheckin.xml");
if (xmlFile.exists) {
var fileXMLtoParse = File (xmlFile);
fileXMLtoParse.open('r');
var str = new XML(fileXMLtoParse.read());
fileXMLtoParse.close();
str.normalize();
var field = str.elements().child(0); // That's the text I need
}
// I have a subpanel with a text field 'text_info' where I put specific xml data
tbPanel.text_info.text = field;
