Copy link to clipboard
Copied
Hi there,
I am using the modified 'Comps to files.jsx' script to export my layer comps (using the label of the layer comp as my file name)
http://www.ps-scripts.com/bb/viewtopic.php?f=9&t=5277
It is a great script and makes my worklfow so much easier.
The only thing missing for me is a trim option when I run this script. as some of the layer comps have different heights
After I run the script, I have to manually crop all the jpgs in PS and then save them out again.
In the default 'Layers to Files' script that comes with PS, there's an option to auto trim png's when exporting the layers
I am thankful for any help on any of these questions I have.
- Is there something similar for layer comps?
- I've modified the original 'Comps to files' script and I now have the option (if I choose png as my file type) to trim the layer, but when I open the exported file it din't crop it.
- Is there an option to auto trim jpgs?
Thank you
Noel
There was a typo on one of the JPG variables. Not sure how it was working for me with that typo. Re-download and try again.
Copy link to clipboard
Copied
El Duderino-
It looks like you swiped code from the Layers to files script, which is a smart place to start, but then you plunked it down in the Layer comps to files script in an area where it's never referenced by the code. Basically you want to take the PNG-8 and PNG-24 code snippets with their respective trim method calls and stick them in the proper case switch, just before the saveFile function is called... and then swap app.activeDocument for docRef since that's variable with your document data that you're passing to the saveFile function.
I uploaded a modified version of the script with these changes here: http://adobe.ly/1vOsgoN, it worked for me on CC 2014 trimming to the transparency. It does JPEG, too
Great name, BTW, I'm not into the whole brevity thing.
Copy link to clipboard
Copied
Thank you very much, mate.
I've run your script, but it doesn't crop the exported layer comps for me. (Running CC2014) Not sure what I am doing wrong.
I have a psd with two shapes, both have a different height. I run your script, with jpg and and trim selected but the exported jpg's still have the the height of the original psd file.
Really appreciate your help on this.
BTW, Greatest movie of all time 🙂
Copy link to clipboard
Copied
There was a typo on one of the JPG variables. Not sure how it was working for me with that typo. Re-download and try again.
Copy link to clipboard
Copied
Dude. Thank you, Thank you,Thank you.
Works amazingly well
Copy link to clipboard
Copied
Thanks a lot for this!
Copy link to clipboard
Copied
You are god among men. This is an awesome resource and save me a ton of time when building out comps for prototyping!!
N
Copy link to clipboard
Copied
Thank you for the amazing script rvrbr8. I do NOT understand why this isn't in the stock 'Layers to Files' script.
I tried to use this in CC 2015 and for JPGs it works, but not for PNGs. For PNGs, the whole transparent artboard is part of the file, but is trimmed off for JPEG, regardless of transparency settings.
Any ideas? Obviously the 'trim' function DOES work in some cases, but not in Photoshop CC 2015 using this script: Adobe Creative Cloud
Copy link to clipboard
Copied
Hi,
I have also tried it in Photoshop CC 2015 and it didn't work.
It is still exporting files without the trim. Please help!
It would be massive improvement to the workflow
Thanks
Copy link to clipboard
Copied
Created a separate batch action to crop PNGs and ran it after running the script and worked fine.
Copy link to clipboard
Copied
HI guys i made an altered version which can also do layer comps from artboards. I also added more options like convert to sRGB and transparency works now for PNG and TIFF
Ill add that layer trim function as well. Need to check what it does actually
You can find my version here; https://community.adobe.com/t5/photoshop/update-layer-comps-amp-artboards-to-files/m-p/10861472#M298...