1 Reply Latest reply on Jun 28, 2013 3:32 AM by JJMack

    Scripting Content Aware Tools?

    chrishallpm

      Is it possible to use the content aware tools such as the Content-Aware Move Tool in scripts?

        • 1. Re: Scripting Content Aware Tools?
          JJMack Most Valuable Participant

          Adobe Photoshop scripting DOM does not support all of Photoshop features. Most of what is not supported can be scripted usinf Adobe Action Manager  using code generated by Adobe's Scriptlistener plug-in.  Look for that plug-in.,

           

          Often you can replace some of the hard coder values with a variable and create a function out of the recorded code.

           

          // =======================================================

          var idrecomposeSelection = stringIDToTypeID( "recomposeSelection" );

              var desc9 = new ActionDescriptor();

              var idnull = charIDToTypeID( "null" );

                  var ref6 = new ActionReference();

                  var idChnl = charIDToTypeID( "Chnl" );

                  var idfsel = charIDToTypeID( "fsel" );

                  ref6.putProperty( idChnl, idfsel );

              desc9.putReference( idnull, ref6 );

              var idT = charIDToTypeID( "T   " );

                  var desc10 = new ActionDescriptor();

                  var idHrzn = charIDToTypeID( "Hrzn" );

                  var idPxl = charIDToTypeID( "#Pxl" );

                  desc10.putUnitDouble( idHrzn, idPxl, 75.000000 );

                  var idVrtc = charIDToTypeID( "Vrtc" );

                  var idPxl = charIDToTypeID( "#Pxl" );

                  desc10.putUnitDouble( idVrtc, idPxl, -126.000000 );

              var idOfst = charIDToTypeID( "Ofst" );

              desc9.putObject( idT, idOfst, desc10 );

              var idTrns = charIDToTypeID( "Trns" );

              desc9.putBoolean( idTrns, false );

              var idpatchMode = stringIDToTypeID( "patchMode" );

              var idpatchModeType = stringIDToTypeID( "patchModeType" );

              var idpatchContentAware = stringIDToTypeID( "patchContentAware" );

              desc9.putEnumerated( idpatchMode, idpatchModeType, idpatchContentAware );

              var idremixMode = stringIDToTypeID( "remixMode" );

              var idremixModeType = stringIDToTypeID( "remixModeType" );

              var idremixMove = stringIDToTypeID( "remixMove" );

              desc9.putEnumerated( idremixMode, idremixModeType, idremixMove );

              var idreshuffle = stringIDToTypeID( "reshuffle" );

              desc9.putBoolean( idreshuffle, true );

              var idclone = stringIDToTypeID( "clone" );

              desc9.putBoolean( idclone, false );

              var idsampleAllLayers = stringIDToTypeID( "sampleAllLayers" );

              desc9.putBoolean( idsampleAllLayers, false );

              var idpatchAdaptation = stringIDToTypeID( "patchAdaptation" );

              var idpatchAdaptationType = stringIDToTypeID( "patchAdaptationType" );

              var idadaptationMedium = stringIDToTypeID( "adaptationMedium" );

              desc9.putEnumerated( idpatchAdaptation, idpatchAdaptationType, idadaptationMedium );

              var iduseSource = stringIDToTypeID( "useSource" );

              desc9.putBoolean( iduseSource, false );

          executeAction( idrecomposeSelection, desc9, DialogModes.NO );