Skip to main content
Inspiring
May 28, 2017

P: Layer effects scripting - 10 bugs - AM code

  • May 28, 2017
  • 11 replies
  • 426 views

I worked on script for removing unused effects. Instead I found total chaos. I found 10 bugs and I found that is impossible to do script which will work correctly.

Here is list of sh*ts

  1. you can't remove layer style/effect if app.doForcedProgress() dialog is shown
  2. you can't remove e.g. second drop-shadow from three even if script listener records code with list item index... it always removes first
  3. you can't use code for removing style/single-effect if all effects are disabled or main visibility is disabled. In photoshop you can do it, but recorded code in script listener doesn't works
  4. if I clear style with drag and drop fx icon to recycle bin, it removes style and keep blending options... but code recorded in script listener doesn't
  5. there is no posibility read options if mask hides effects... so if you read descriptor, change values and set descriptor, it always reset these settings to default values
  6. action "paste layer effect and keep advanced blending" is incorectly recorded in script listener
  7. if you remove multiple dropshadow effects and last dropshadow remaining you can't remove it with AM code. (It's no longer list of shadows but single shadow.)
  8. same situation from point 7 is in case that you want/show hide effect
  9. using modified descriptor for removing style has same bug as point 3. ...you just can't set "enabled=false" and "present=false" for all effects
  10. show/hide all effects doesn't works whole style visibility is disabled... there are three states of visibility icon. "white - Visible", "grayed - hidden", "invisible - hidden"

And some other bugs I don't remeber now.

I tried to read style descriptor, modify apply
> I can't beacause bugs: 5, 3

I tried to remove effects one by one
> I can't bugs 2
So I did some sorting if there is multiple effects of same kind and layer visibility changes
> Doesn't works - bugs 7,8,3

logged: bug ID: PS-9050

This topic has been closed for replies.

11 replies

Inspiring
January 24, 2018
I think some of these bugs were fixed in CC2018.1

looks like 2, 4 are fixed. And I quickly tried some other but looks like no improvement, but I didn't tested all with precisely.
Inspiring
November 1, 2017
Logged bug ID: PS-9050 has same untouched state since it's creation. So I don't think it's fixed. I will test it in next weeks/months.
Known Participant
November 1, 2017
Any idea if some of these were fixed in 2018? 
Inspiring
June 5, 2017
Max: my theory was confirmed. Script works as I said. http://bereza.cz/ps/ (Clear hidden effects 1.1 )

It's slower than version 1.0 but it seems to be bulletproof from CS6 to CC2017
Inspiring
June 5, 2017
bug #11 - you can move style/effect even if layer is locked.

Normally you can't do it. 
Simplest thing how to verify this is recording action without locks and then lock layers and run action.
Inspiring
May 30, 2017
Maybe they will be saved from pain if they decide just don't do anything advanced with effects or don't care about zero bug tolerance. Otherwise... good luck they will need it a lot 😄
Known Participant
May 30, 2017
Thank you for the clarification! I'm sure it will save me and others a lot of headache till this can get sorted out.
Inspiring
May 30, 2017
Anyway if style has zero effects or all effects has boolean property present=false then whole style is removed. So you can remove partial effects until there are some and finaly whole style is removed. But it takes more time. Something about 30-40ms per effect.
Inspiring
May 30, 2017
If you want remove unused style and effects you have two cases:
1) you want remove whole style
2) you want remove one effect from style

So you can
1)
a) create new empty layer without effects and style
b) move style from current layer to new layer. So you removed whole style from current layer
c) repeat for another layer or remove empty layer

2)
a) create new empty layer without effects and styles
b) move single effect of style from current layer to new empty layer. So you removed single effect from current layer style
c) repeat for another effect in style or another layer or you can remove new empty layer itself. Make sure that there is less than 10 multi-effects if you want move effect

But it's not yet properly tested.

---
What you wrote could work. But it depends what you want to keep. Moving whole style replace all effects in both layers.
Known Participant
May 30, 2017
So you are saying that you can do something like:

- Have a styled layer with fx and a drop shadow.
- Create new empty layer
- Create drop shadows on new empty layer
- "Move" drop-shadow #2 onto previous layer
- End up with original layer having 2 drop shadows

or is it more like?
- Have styled layer
- create new empty layer
- move whole style onto new layer
- move individual style components back to original layer