Photoshop: PSD to XML conversion

  • 1
  • Question
  • Updated 1 year ago
  • (Edited)
I want some information related to plugins for photoshop. I have a requirement where in I have a PSD in the format of groups containing multiple layers. I want to convert this PSD in XML format containing grouped level of information. I had got some of the plugins available online but they were un-grouping all the layers and providing all layers in single hierarchy.Also I am also trying to get text layer distinction from image layer. Any help is appreciated.
Photo of Navani Srivastava

Navani Srivastava

  • 4 Posts
  • 1 Reply Like

Posted 2 years ago

  • 1
Photo of Max Johnson

Max Johnson, Champion

  • 488 Posts
  • 235 Reply Likes
Could we get some more information, please?

Are you writing a full plugin in C#, scripting in javascript, or writing a node panel extension?

What plugins have you already tried?
Photo of Navani Srivastava

Navani Srivastava

  • 4 Posts
  • 1 Reply Like
Yes, sure.

I am trying to write this plugin in java script and I was referring the script available in with minor changes like redirecting all properties data to XML file.
Photo of Navani Srivastava

Navani Srivastava

  • 4 Posts
  • 1 Reply Like
12 days before there was a checkin on the link mentioned above, and that checkin brings fetching layers in the form of groups created functionality. So looks like one issue is resolved. It would be really a great help if I can get to know how to distinguish text layer from image layer? Thanks
Photo of Max Johnson

Max Johnson, Champion

  • 480 Posts
  • 225 Reply Likes
If you follow the link @Jeff posted to the scripting documentation, there's a javascript photoshop reference PDF that has the properties for artLayer. There's a "kind" property with the following enum results:

In the script you posted, there's a function isAdjustmentLayer(layer) that should show you exactly how to find what you need for the text layer check.

if (layer.kind == LayerKind.TEXT ) { doTheThing();}
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 14435 Posts
  • 1857 Reply Likes
Yes, the scripting API should allow you to distinguish between pixel layers and text layers. You can find the reference documentation here:

Also, check out - it's a community focused entirely on scripting Photoshop.
Photo of Navani Srivastava

Navani Srivastava

  • 4 Posts
  • 1 Reply Like
@Jeffrey @Max Thanks a lot for your inputs. This is exactly what I was looking for. I am sure I should be able to create the desired XML now
Photo of Ranit Sanyal

Ranit Sanyal

  • 1 Post
  • 0 Reply Likes
What I noticed with using scripts is that it doesn't provide desired results if the flow is little complex. Most of the time when working on unique designs automation didn't helped me. Later I had to use PSD to XML conversion service and then with human interaction I got my job done. 

Automation still have a long way to go, though what Adobe is doing I am really optimistic about the future.