Skip to main content
Inspiring
July 14, 2022
Question

Apply filter via code

  • July 14, 2022
  • 1 reply
  • 174 views

I'm I correct in thinking that only a few filters are availabe directly in code?

 

var b = 100;
// Spherize
activeDocument.activeLayer.applySpherize(b, SpherizeMode.NORMAL);

Spherize is fine, but using pixelate mosaic one is force to use script listner code:

 

var mosaicAmt = 8;
apply_mosaic(mosaicAmt);

function apply_mosaic(val)
{
   var idMsc = charIDToTypeID( "Msc " );
   var desc5842 = new ActionDescriptor();
   var idClSz = charIDToTypeID( "ClSz" );
   var idPxl = charIDToTypeID( "#Pxl" );
   desc5842.putUnitDouble( idClSz, idPxl, val );
   executeAction( idMsc, desc5842, DialogModes.NO );
}

 

Or am I missing a trick somewhere?

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
July 14, 2022

Indeed, not every function is available via DOM-code.