Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Apply filter via code

Engaged ,
Jul 14, 2022 Jul 14, 2022

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?

TOPICS
Actions and scripting
176
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jul 14, 2022 Jul 14, 2022
LATEST

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

Screenshot 2022-07-14 at 14.23.41.pngScreenshot 2022-07-14 at 14.23.50.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines