4 Replies Latest reply on Jan 11, 2015 5:16 AM by JJMack

    do the ps sdk have the Apply Image method?

    zhangzaigang

      i do not find it ! help me

        • 1. Re: do the ps sdk have the Apply Image method?
          xbytor2 Level 4

          It's not part of the PS/JS DOM. You'll have to use ActionManager code from ScriptingListener code.

          • 2. Re: do the ps sdk have the Apply Image method?
            zhangzaigang Level 1

            if  someone can right The layer blending mode of ps by js?

            • 3. Re: do the ps sdk have the Apply Image method?
              zhangzaigang Level 1

              i think the apply image is the layer blending mode

              • 4. Re: do the ps sdk have the Apply Image method?
                JJMack Most Valuable Participant

                Menu Image>Apply Image is quite complex does have a blending mode component can be between document use selected  channels specify an opacity use masking too complicated for my mind to comprehend. There is no DOM interface but Action Manager Code is recorded by the Scriptlistener plugin the you can use in scripts. For example here is a screen grab of the setting used and the code generated by the scriptlistener.

                 

                Capture.jpg

                 

                 

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

                var idAppI = charIDToTypeID( "AppI" );

                    var desc8 = new ActionDescriptor();

                    var idWith = charIDToTypeID( "With" );

                        var desc9 = new ActionDescriptor();

                        var idT = charIDToTypeID( "T   " );

                            var ref5 = new ActionReference();

                            var idChnl = charIDToTypeID( "Chnl" );

                            var idChnl = charIDToTypeID( "Chnl" );

                            var idRGB = charIDToTypeID( "RGB " );

                            ref5.putEnumerated( idChnl, idChnl, idRGB );

                            var idLyr = charIDToTypeID( "Lyr " );

                            var idBckg = charIDToTypeID( "Bckg" );

                            ref5.putProperty( idLyr, idBckg );

                            var idDcmn = charIDToTypeID( "Dcmn" );

                            ref5.putName( idDcmn, "texture" );

                        desc9.putReference( idT, ref5 );

                        var idClcl = charIDToTypeID( "Clcl" );

                        var idClcn = charIDToTypeID( "Clcn" );

                        var idpinLight = stringIDToTypeID( "pinLight" );

                        desc9.putEnumerated( idClcl, idClcn, idpinLight );

                        var idOpct = charIDToTypeID( "Opct" );

                        var idPrc = charIDToTypeID( "#Prc" );

                        desc9.putUnitDouble( idOpct, idPrc, 50.000000 );

                        var idPrsT = charIDToTypeID( "PrsT" );

                        desc9.putBoolean( idPrsT, true );

                        var idUsMs = charIDToTypeID( "UsMs" );

                            var ref6 = new ActionReference();

                            var idChnl = charIDToTypeID( "Chnl" );

                            var idChnl = charIDToTypeID( "Chnl" );

                            var idGry = charIDToTypeID( "Gry " );

                            ref6.putEnumerated( idChnl, idChnl, idGry );

                        desc9.putReference( idUsMs, ref6 );

                        var idInvM = charIDToTypeID( "InvM" );

                        desc9.putBoolean( idInvM, true );

                    var idClcl = charIDToTypeID( "Clcl" );

                    desc8.putObject( idWith, idClcl, desc9 );

                executeAction( idAppI, desc8, DialogModes.NO );