i want to make a photoshop script that would let me export layers data into a JSON file with the intention to recreate the layer or the content of that layer in an other application using the Json file. i am new in photoshop scripting, i read the official documentation here http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref-2015.pdf scrolling over the properties of the ArtLayer object. i couldn't find a property that could store the data i am looking for which is either the path to an uploaded image or an array of pixels for that layer. i want to know if this is something that can be accomplished? And if so, is anyone prepared to help me?
1 Answers
0
votes
If I understand correctly, you are trying to export pixel data from layers to use in another application. Unfortunately, there are no methods on the Photoshop DOM interface to directly access pixel values of layers or the canvas, and JSON would probably not be your most efficient way of transferring that information anyway. One option would be export a single layer to disk and use ports to let the other app know about it. Interapplication communication is documented in chapter five of the Javascript Tools Guide. As for exporting a single layer, I would recommend using Generator. You can reference the source for the Generator plugin bundled with Photoshop to get an idea of how this could work.