Photoshop: Ability to remove/purge layers not used in any Layer Comp

  • 11
  • Idea
  • Updated 3 years ago
  • (Edited)
I work extensively with deeply-layered screen-resolution documents (ie. mock-ups). I like to keep my history -- or at least some of it -- of experiments as Layer Comps. But every now and again, these PSDs will get prohibitively heavy.

So what I'm looking for is a command, or script, that will let me purge any layer which is not visible in ANY Layer Comp in the file.

Does such a script exist?
Photo of Rasmus Keldorff

Rasmus Keldorff

  • 4 Posts
  • 2 Reply Likes
  • confident

Posted 7 years ago

  • 11
Photo of roman weiser

roman weiser

  • 61 Posts
  • 9 Reply Likes
Rasmus, I'm not sure if this will help. Perhaps I did not understand your issue correctly.

But if you need simply remove all non-viewed Layers in a document, then you can do this by choosing Layer Palate Option and selecting the option 'Delete Hidden Layers'.

Hope this helps ;)
Photo of Rasmus Keldorff

Rasmus Keldorff

  • 4 Posts
  • 2 Reply Likes
Thanks, but I meant exactly what I said :-)

ie.:
- search through all Layer Comps, building a total list of used layers
- finally, delete any layers not used in any Layer Comp

I dug a bit and found a couple of scripts that users made which purportedly do this. I wasn't able to get any of them to work. Should be a simple job and would be very helpful as a PS feature. I often need it.
Photo of Octop

Octop

  • 27 Posts
  • 4 Reply Likes
And how about one better? Why not be able to set a setting on your PSD that trims all layers to size. That way the app automatically removes blank layer margin pixels. They're not necessary in smart comps most often.

But basically what the guy wants is a way to optimize the PSD as it saves, because there's PSDs that weigh about let's say 1GB, and if it was all trimmed and optimized, then it may be...say 200MB. Some people's workflow (such as mine) utilizes a lot of different extra layers that we turn on and off or use to make layer masks. Then 50GB of your harddrive goes to 50 Psds. Not that I don't gladly store all my PSDs for future use, but after a few years of work, it becomes an issue.
Just imagine the 50GB cache of a person's PSD files gets to 5 or even 10GB instead of the 50.

Is there a quick way to crop/minimize layers?
Photo of Paul Riggott

Paul Riggott

  • 359 Posts
  • 141 Reply Likes
I have just written a script here to do this...
http://forums.adobe.com/thread/973796...
Photo of lee

lee

  • 25 Posts
  • 7 Reply Likes
Scripts scare me, so I found a really freaking easy workaround:

1. Filter layers list to Attribute = Not Visible
2. Select all the matching layers
3. Cycle through all layer comps
4. Layers still selected aren’t used in any layer comp

Delete the layers that are still selected. Bingo bango. With keyboard shortcuts for navigating layer comps, this takes like 7 seconds or something.
Photo of Andrew Betlyon

Andrew Betlyon

  • 1 Post
  • 0 Reply Likes
Really smart. Thanks!
Photo of ninjette

ninjette

  • 1 Post
  • 0 Reply Likes
Brilliant workaround.
Thanks!
Photo of Amber Muck

Amber Muck

  • 2 Posts
  • 1 Reply Like
I would still prefer something built into Photoshop without a workaround or a script.