I Make panel for Photoshop CC 2015. It will contain several elements - inputs, selects, checkboxes, tabs. I want to fill in the required fields when opening the panel. For the convenience information want to keep in a XML file - the name of the user, the list of project folders, etc.
I think that you need to have an additional file (XML ?) with a description what item (id elements) is what value to set (<li 2 selected>) or show ('Andy') .
Can't quite come up with the mechanism for implementing this. I would be grateful for tips, examples, ideas.
<prop> <user>John</user> <firstInput>Whatever</firstInput> <prop>
You can read it and then assign to, say, an input text the value in the JS:
document.getElementById("firstInput").value = firstInputValue;
To parse an XML file you should be able to:
var dataString = cep.fs.readFile(filePath) // sync process var dataObj = (new window.DOMParser()).parseFromString(dataString, "text/xml");
Then you should be able to:
firstInputValue = dataObj.firstInput;
I haven't tested this myself but it should do the job, let me know.