Mobile app version of vmapp.org
Login or Join
RJPawlick971

: Exporting trimmed layers with their position I'm trying to do some basic stuff. I have a psd file with plenty of layers. Just one of the is the background and all the rest are objects above

@RJPawlick971

Posted in: #Export #Layers

I'm trying to do some basic stuff. I have a psd file with plenty of layers. Just one of the is the background and all the rest are objects above the background (each one separated in one different layer).

I want to export this to files. So I used the 'Export layers to files' option, which worked just fine and trimmed the layers to its boundaries as I wanted. The only problem is that now I have to go layer by layer to check its object absolute position in the background and make a list (I'm using this for programming purposes).

What I'd like to have, which shouldn't be so difficult, is the coordinates of the trimmed layer in the whole background. Is there a way to obtain this programmatically?

Thanks in advance,
Martín

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @RJPawlick971

2 Comments

Sorted by latest first Latest Oldest Best

 

@Jennifer810

This is a version-dependent answer, because you'll need to be on CS6 or later.


Select a layer
Layer > Copy CSS
Paste to your text editor of choice


Repeat this process for each layer. If you've enough layers, or this is something you're likely to want to do regularly, you can automate this with an action.

This second Method requires Ps CC:

In Ps CC, the Generate function in the File menu, especially when it's used in conjunction with the Adobe Layer Namer panel, automates the export of images and can save time because the images are updated instantly as things change in the PSD.

Ps can also create an Edge Reflow project automatically via File > Generate > Edge Reflow Project. As of this writing, the process remains quite buggy, but once Reflow gets out of "Preview" stage, there may be a very fast workflow available.

10% popularity Vote Up Vote Down


 

@Cofer715

I only have the cs4 photoshop scripting reference on hand (freely available from adobe).

The object name for a layer is ArtLayer and there is a property called Bounds which is:


Read-only. An array of coordinates that describes the bounding
rectangle of the ArtLayer.


This might allow you to query the layers and extract the data you need. The trick would be to align this data with the files but if they are named the same as the layers, it would be trivial.

google terms:
photoshop_cs4_vbscript_ref.pdf
photoshop_cs4_scripting_guide.pdf
photoshop_cs4_javascript_ref.pdf

There is probably an Actionscript reference as well. Scripts can be run from within the application, but you can write OS-hosted scripts and still access the objects.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme