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
May 30, 2017
Seems to that I finally found something what maybe is not messed up. I can create empty layer and move whole style or partial effect to new layer and then delete it. If empty layer already has style then whole styles are replaced with new. Single effects are replaced. Multi effect are added to existing and has limit of 10 effects.

1) it doesn't reset advanced blending
2) I can pick which e.g. drop shadow I want by specific index
3) Looks like doesn't matter if whole style or partial effects are visible