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
- you can't remove layer style/effect if app.doForcedProgress() dialog is shown
- 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
- 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
- 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
- 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
- action "paste layer effect and keep advanced blending" is incorectly recorded in script listener
- 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.)
- same situation from point 7 is in case that you want/show hide effect
- 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
- 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