1 Reply Latest reply on Jan 2, 2017 8:31 AM by rechmbrs

    Jsx file hide layer style in layer palette

    rechmbrs Level 1

      I have a Jsx file that executes fine except that the layer style info shows through out the process.   I've been able to hide the history from showing.   I would prefer that the user not know what is going on inside the script.   Script was initially developed from an action then atn2jsx was applied.   Looks like I needed to clicked the fx arrow to hide when I built the action.

       

      Thanks,

      RONC

        • 1. Re: Jsx file hide layer style in layer palette
          rechmbrs Level 1

          The following is from an atn2jsx run on the atn I generated in PSCC 2017 for a Pattern style applied to a layer .   See ********** on line to change.

           

            function step09(enabled, withDialog) {

              if (enabled != undefined && !enabled)

                return;

              var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);

              var desc1 = new ActionDescriptor();

              var ref1 = new ActionReference();

              ref1.putProperty(PSClass.Property, PSClass.LayerEffects);

              ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);

              desc1.putReference(PSKey.Target, ref1);

              var desc2 = new ActionDescriptor();

              desc2.putUnitDouble(PSKey.Scale, PSUnit.Percent, 416.666666666667);

              var desc3 = new ActionDescriptor();

              desc3.putBoolean(PSKey.Enabled, true);

              desc3.putBoolean(PSString.present, true);

              desc3.putBoolean(PSString.showInDialog, false);            **********   changed from true

           

              desc3.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Multiply);

              desc3.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);

              var desc4 = new ActionDescriptor();

              desc4.putString(PSKey.Name, "frame 4");

              desc4.putString(PSKey.ID, "8233a751-cd92-11e6-be38-c71308788234");

              desc3.putObject(PSEnum.Pattern, PSEnum.Pattern, desc4);

              desc3.putUnitDouble(PSKey.Scale, PSUnit.Percent, 100);

              desc3.putBoolean(PSKey.Alignment, true);

              var desc5 = new ActionDescriptor();

              desc5.putDouble(PSKey.Horizontal, 0);

              desc5.putDouble(PSKey.Vertical, 0);

              desc3.putObject(PSString.phase, PSClass.Point, desc5);

              desc2.putObject(PSString.patternFill, PSString.patternFill, desc3);

              desc1.putObject(PSKey.To, PSClass.LayerEffects, desc2);

              executeAction(PSEvent.Set, desc1, dialogMode);

            };

           

           

           

           

           

           

           

          PSClass.Layer = cTID('Lyr ');

            PSClass.LayerEffects = cTID('Lefx');

            PSClass.Point = cTID('Pnt ');

            PSClass.Property = cTID('Prpr');

            PSClass.Version = cTID('Vrsn');

            PSEnum.Multiply = cTID('Mltp');

            PSEnum.Pattern = cTID('Ptrn');

            PSEnum.Target = cTID('Trgt');

            PSEvent.Duplicate = cTID('Dplc');

            // PSEvent.Rasterize = cTID('Rstr');

            PSEvent.Rasterize = sTID('rasterizeLayer');

            // var idrasterizeLayer = stringIDToTypeID( "rasterizeLayer" );

            PSEvent.Select = cTID('slct');

            PSEvent.Set = cTID('setd');

            PSKey.Alignment = cTID('Algn');

            PSKey.Enabled = cTID('enab');

            PSKey.Horizontal = cTID('Hrzn');

            PSKey.ID = cTID('Idnt');

            PSKey.LayerID = cTID('LyrI');

            PSKey.MakeVisible = cTID('MkVs');

            PSKey.Mode = cTID('Md  ');

            PSKey.Name = cTID('Nm  ');

            PSKey.Opacity = cTID('Opct');

            PSKey.Scale = cTID('Scl ');

            PSKey.Target = cTID('null');

            PSKey.To = cTID('T   ');

            PSKey.Vertical = cTID('Vrtc');

            PSKey.What = cTID('What');

            PSString.layerStyle = sTID('layerStyle');

            PSString.patternFill = sTID('patternFill');

            PSString.phase = sTID('phase');

            PSString.present = sTID('present');

            PSString.rasterizeItem = sTID('rasterizeItem');

            PSString.showInDialog = sTID('showInDialog');

            PSType.BlendMode = cTID('BlnM');

            PSType.Ordinal = cTID('Ordn');

            PSUnit.Percent = cTID('#Prc');

          };