2 Replies Latest reply on Feb 25, 2015 7:55 AM by Koen Van Riel

    adjustment layer: solid fill

    Koen Van Riel

      Hi I'm looking for a way to create an adjustment layer kind :"solid fill"  with applescipt.

      It should have a fill with an Lab color (eg; L= 20, a=10, b=13)

       

      Code:

       

         tell application "Adobe Photoshop CS3"

             tell current document

                set newLayer to make art layer with properties {name:"MyInkName", kind:solid fill layer, color:{class:Lab color, value_L:20, value_a:10, value_b:13}}

               end tell

        end tell

       

       

      error:

       

      You can only change the layer's kind to text or normal.

       

      Thanks,

       

      Koen

        • 1. Re: adjustment layer: solid fill
          c.pfaffenbichler Level 9

          You may have to use the JavaScript code created with ScriptingListener.plugin.

           

          Why do you use AppleScript?

          • 2. Re: adjustment layer: solid fill
            Koen Van Riel Level 1

            I don't know java script.

            Also I get the lab values from an excel sheet with applescript.

            I found this java code but it needs the be changed:

            1) I want lab values and the this code generates an RGB color

            2) I need to input the lab values from applescript

             

            How can I do this?

             

            Tnx

             

            tell application "Adobe Photoshop CS3"

            activate

              do javascript "var id115 = charIDToTypeID( \"Mk  \" );

                var desc21 = new ActionDescriptor();

                var id116 = charIDToTypeID( \"null\" );

                    var ref8 = new ActionReference();

                    var id117 = stringIDToTypeID( \"contentLayer\" );

                    ref8.putClass( id117 );

                desc21.putReference( id116, ref8 );

                var id118 = charIDToTypeID( \"Usng\" );

                    var desc22 = new ActionDescriptor();

                    var id119 = charIDToTypeID( \"Type\" );

                        var desc23 = new ActionDescriptor();

                        var id120 = charIDToTypeID( \"Clr \" );

                            var desc24 = new ActionDescriptor();

                            var id121 = charIDToTypeID( \"Rd  \" );

                            desc24.putDouble( id121, 9.999847 );

                            var id122 = charIDToTypeID( \"Grn \" );

                            desc24.putDouble( id122, 39.999390 );

                            var id123 = charIDToTypeID( \"Bl  \" );

                            desc24.putDouble( id123, 49.999237 );

                        var id124 = charIDToTypeID( \"RGBC\" );

                        desc23.putObject( id120, id124, desc24 );

                    var id125 = stringIDToTypeID( \"solidColorLayer\" );

                    desc22.putObject( id119, id125, desc23 );

                var id126 = stringIDToTypeID( \"contentLayer\" );

                desc21.putObject( id118, id126, desc22 );

            executeAction( id115, desc21, DialogModes.NO );"

            end tell