1 Reply Latest reply on Apr 1, 2015 5:10 AM by c.pfaffenbichler

    Add vector mask to artLayer [PS CS5 JS]

    Emanuele Radaelli Level 1

      Is there a way to make it.

      Looks like the artLayer object doesn't have any method to make this...

        • 1. Re: Add vector mask to artLayer [PS CS5 JS]
          c.pfaffenbichler Level 9

          You need to use Action Manager code (as recorded by ScriptingListener.plugin).

          // 2015, use it at your own risk;
          #target photoshop
          if (app.documents.length > 0) {
          try {
          // =======================================================
          var idMk = charIDToTypeID( "Mk  " );
              var desc5 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
                  var ref3 = new ActionReference();
                  var idPath = charIDToTypeID( "Path" );
                  ref3.putClass( idPath );
              desc5.putReference( idnull, ref3 );
              var idAt = charIDToTypeID( "At  " );
                  var ref4 = new ActionReference();
                  var idPath = charIDToTypeID( "Path" );
                  var idPath = charIDToTypeID( "Path" );
                  var idvectorMask = stringIDToTypeID( "vectorMask" );
                  ref4.putEnumerated( idPath, idPath, idvectorMask );
              desc5.putReference( idAt, ref4 );
              var idUsng = charIDToTypeID( "Usng" );
                  var ref5 = new ActionReference();
                  var idPath = charIDToTypeID( "Path" );
                  var idOrdn = charIDToTypeID( "Ordn" );
                  var idTrgt = charIDToTypeID( "Trgt" );
                  ref5.putEnumerated( idPath, idOrdn, idTrgt );
              desc5.putReference( idUsng, ref5 );
          executeAction( idMk, desc5, DialogModes.NO );
          } catch (e) {}
          };