19 Replies Latest reply on Mar 2, 2011 5:33 PM by gmitchel

    Smart Filter Layers and Snow Leopard

    gmitchel Level 1

      I posted this in the Photoshop API forum and got no response. Maybe I'll have better luch here.

       

      I have several ActionScript wrappers for Javascript code generated by the ScriptListener plug-in that manipulate Smart Filter layers. The code runs without any error under Windows. With Snow Leopard, it generates errors about the Set and Delete commands not being available for the smart Filter layers.

       

      Suggestions about this would be appreciated.

       

      Code samples follow.

       

      Mitch

       

       

      This code generates an error stating the "Set" command is not available:

      private function applyNormalBlendToSmartFilterEffect():void {

       

       

       

           try {

       

                var idsetd:int = Photoshop.app.charIDToTypeID( "setd" );

       

                var desc13:ActionDescriptor = new ActionDescriptor();

       

                var idnull:int = new int;

       

                var ref6:ActionReference = new ActionReference();

       

                var idfilterFX:int = Photoshop.app.stringIDToTypeID( "filterFX" );

       

                var idLyr:int = Photoshop.app.charIDToTypeID( "Lyr " );

       

                var idOrdn:int = Photoshop.app.charIDToTypeID( "Ordn" );

       

                var idTrgt:int = Photoshop.app.charIDToTypeID( "Trgt" );

       

                var desc14:ActionDescriptor = new ActionDescriptor();

       

                var idblendOptions:int = Photoshop.app.stringIDToTypeID( "blendOptions" );

       

                var desc15:ActionDescriptor = new ActionDescriptor();

       

                var idOpct:int = Photoshop.app.charIDToTypeID( "Opct" );

       

                var idPrc:int = Photoshop.app.charIDToTypeID( "#Prc" );

       

                var idMd:int = Photoshop.app.charIDToTypeID( "Md " );

       

                var idBlnM:int = Photoshop.app.charIDToTypeID( "BlnM" );

       

                var idDrkn:int = Photoshop.app.charIDToTypeID( "Nrml" );

       

           catch(error:Error) {

       

      "Error in applyNormalBlendToSmartFilterLayer(): " + error.message, "Error!", Alert.OK, Sprite(mx.core.Application.application));

       

       

       

      This code generates an error stating the Delete command is not available.

       

       

      private function deleteLayerEffectsMask():void {

       

           try {

       

                var idDlt:int = Photoshop.app.charIDToTypeID( "Dlt " );

       

                var desc3:ActionDescriptor = new ActionDescriptor();

       

                var idnull:int = new int;

       

                var ref2:ActionReference = new ActionReference();

       

                var idChnl:int = Photoshop.app.charIDToTypeID( "Chnl" );

       

                var idfilterMask:int = Photoshop.app.stringIDToTypeID( "filterMask" );

       

           catch(error:Error) {

       

      "Error in deleteLayerEffectsMask(): " + error.message, "Error!", Alert.OK, Sprite(mx.core.Application.application));

       

       

           }

      }

                Alert.show(

                     ref2.putEnumerated( idChnl, idChnl, idfilterMask );

                     desc3.putReference( idnull, ref2 );

                Photoshop.app.executeAction( idDlt, desc3, DialogModes.NO );

           }

       

       

       

       

       

       

       

       

           }

       

      }

       

                Alert.show(

                     desc15.putEnumerated( idMd, idBlnM, idDrkn );

                     desc14.putObject( idblendOptions, idblendOptions, desc15 );

                     desc13.putObject( idfilterFX, idfilterFX, desc14 );

                Photoshop.app.executeAction( idsetd, desc13, DialogModes.NO );

           }

       

       

       

                     desc15.putUnitDouble( idOpct, idPrc, 100.000000 );

       

       

       

       

       

                     ref6.putEnumerated( idLyr, idOrdn, idTrgt );

                     desc13.putReference( idnull, ref6 );

       

       

       

                     ref6.putIndex( idfilterFX, 1 );