Skip to main content
Shulipa Bernad
Inspiring
January 26, 2021
Question

Get value of filters in smart filter

  • January 26, 2021
  • 1 reply
  • 456 views

Hi!
Guys is there any possibility to get the values of all filters applied to a smart filter? I would like to obtain the values of each item as shown in the image below: Thank you.

 
This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
January 26, 2021

I was surprise when I saw your screen capture  I did not realize that Adjustment could be used like smart filters.  I add adjustment layers.  IMO adjustment layer are more versatile then smart filters for each can be masked.  Where as a smart object layer can only have a single filter mask that mask all added filters.   If Smart filters settings can be retrieved you would need to learn how to code Action Manger Code.  See if  a smart object layer has Smart filters and then be able to access each one to get their current settings.  You will not find any Adobe DOM method for many of Photoshop feature.  Photoshop scripts  often need to script thing through the action manager.

JJMack
Shulipa Bernad
Inspiring
January 26, 2021

I believe that it is possible, here in this community on another occasion, I found a small script that displays the amount of defocus applied in a smart filters, but I didn't get anything about the other filters.

try{
    var r = new ActionReference();      
    r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("smartObject"));  
    r.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));  
    var ret = executeActionGet(r);  
    ret = ret.getObjectValue(stringIDToTypeID("smartObject"));  
    ret = ret.getList(stringIDToTypeID("filterFX"));  
    ret = ret.getObjectValue(0);  // 0 -> filter index;  
    ret = ret.getObjectValue(stringIDToTypeID("filter"));  
    ret = ret.getUnitDoubleValue(stringIDToTypeID("radius"));  
} catch(e){ret= 0}

 alert(ret);