Definition of the color layer with javascript property

Is it possible to set the color of a layer in the layers palette using javascript?

By default, everything appears colorless layer, but if you right-click (ctrl-click) on a layer you can change the color of red, Orange, yellow, etc..

My question is can I do this with a script?

I can lock a layer, modify its visibility and opacity, but I can't find a reference to this particular property.

Any help is appreciated.

Thank you


Zara

This will set the color of the active layer...

layerColour("Violet");

function layerColour(colour) {
    switch (colour.toLocaleLowerCase()){
        case 'red': colour = 'Rd  '; break;
        case 'orange' : colour = 'Orng'; break;
        case 'yellow' : colour = 'Ylw '; break;
        case 'yellow' : colour = 'Ylw '; break;
        case 'green' : colour = 'Grn '; break;
        case 'blue' : colour = 'Bl  '; break;
        case 'violet' : colour = 'Vlt '; break;
        case 'gray' : colour = 'Gry '; break;
        case 'none' : colour = 'None'; break;
        default : colour = 'None'; break;
        }
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc.putReference( charIDToTypeID('null'), ref );
        var desc2 = new ActionDescriptor();
        desc2.putEnumerated( charIDToTypeID('Clr '), charIDToTypeID('Clr '), charIDToTypeID(colour) );
    desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), desc2 );
    executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
};

Tags: Photoshop

Similar Questions

  • Keyboard shortcut for fill with the color layer are opposed on my PS CS6 OSX install help?

    Hi all

    I'm kinda a noob and following a tutorial... and found something strange and I wonder if you could help me understand what is happening.

    I have Photoshop CS6 extended on a macbook pro (late 2011).

    I am running OSX v 10.7.5

    I'm the long and the instructor has added a new layer. I did it.

    He then filled the white layer which is its background color (it has foreground black, white background). I have same evidence / background colors.

    Now I thought on mac to fill with the foreground color, you hit Apple + Delete and to fill it with the background, press Option + delete

    It's the exact OPPOSITE for me. I hit Apple + DELETE (or even BACKSPACE) and filled it with my background color, which is white

    If I hit Option + DELETE (or RET.), filled it with my foreground color.

    I tried searching in the area of keyboard shortcuts change... but I do not see these settings anywhere.

    I have an external keyboard plugged into my mac. It is a 3rd party one, but seems otherwise never function normally.

    Keyboard here is: http://pckeyboard.com/page/UKBD/UB40P4A

    Any suggestions why my shortcut keyboard for a fill with the color layer could be reversed?

    Thanks in advance,

    CC

    Looks like it doesn't work as expected

    keyboard shortcuts in Photoshop to paintng:

    https://helpx.Adobe.com/Photoshop/using/default-keyboard-shortcuts.html#keys_for_painting

  • How to call the java function with javascript setting in mobile adf?

    How to call the java function with javascript setting in mobile adf?

    The ADF Mobile utility container API can be used from JavaScript or Java.

    Application container API - 11 g Release 2 (11.1.2.4.0)

  • You can change the background color vi with a property node?

    I was wondering if it was possible in Labview to use a property node to change the background color of façade for an iteration, then back to an original color later. I don't think it's possible, but I would like to know for sure.

    Thank you

    Jody

    You can get the property pane directly node by right-clicking the scroll bar on the front panel and create-> property Node-> color pane.  Useful with multiple panes.  You can also click the property pane node in example of (imstuck) and choose link and then select the pane.

  • How do you turn off the coast of the coloring layer to animate?

    Hello!

    I've updated to animate and onion skin frames are color coded. Anyone know how to disable this option? I can't find an option to do so, and unfortunately it fills completely the previous and future frames with a solid color that darkens the Interior details of the images really, really bad. I understand how this could be useful to animate solid forms such as stick figures, but it killed my workflow.

    Thanks for any help.

    Hello

    I want to just inform you that animate CC 2015.2 released a few days back allows you to change the colors of onion skins of your choice. In addition, this version includes the following

    Please update your copy of CC animate to the latest (15.2.0.66) using your Creative Cloud Desktop application. Logout & Sign - in in case you don't see Animate CC 2015.2 in your creative cloud application.

    Animation of the happy!

    Thank you!

    Mohan

  • Change the color layer

    I'm new on this and have spent hours trying to change my blue curve on the right to a pink curve in Photoshop.

    Also somebody can help me change the transparent background? http://www.beccagray.co.UK

    Thank you

    Helen

    I think for this particular project, you will get much better results by making a new line and using the tool pen

    is not difficult for this kind of thing. Replace color not give good results.

    (it comes to cs3, but everything is the same in cs4)

    1. Select the pen tool and set options in the toolbar options as below.

    2. with the pen tool, click on the upper part of the line and then click on the bottom of the line to a straight path.

    3. place a dot in the Center by pointing the cursor on the line until you see a + symbol and click.

    4. press the button of ctl to switch to direct and make Selection tool drag the center point on the line.

    (you may need to move the other two points to center the path to the line)

    (if you can't get the direct Selection tool by pressing the Ctrl key, use the direct Selection tool in the Toolbox)

    5. make a new empty layer, select the Brush tool and set your brush. I used a round brush to 3 px diameter and

    Set your foreground color to the color pink you want.

    6. press the Enter key on the keyboard to stroke the path or go in the paths Panel and select the path.

    MTSTUNER

  • "import as layer" with javascript?

    Hello!

    I was wondering if there is one here who could give me some batch processing javascript in Acrobat tips. My problem is the following... I have many (thousands) of pdf that have an object on a layer with incorrect data. In Illustrator, I wrote a script which allows to reconstruct this object fills with correct data from a csv file and then saves in a pdf file with a name that matches the master pdf, in that it must be inserted.

    What I want to do with a batchscript of javascript is for each open file is to find the file name and the newly created pdf file is found (done) then do something equivalent to the command "import as layer" and import to an existing layer already in the main PDF so the new masks the old object. This I can't do... Well, really, I can't do a lot with js in acrobat for that matter. I can't even a var to return a value to the colsole for testing. It returns no "defined."

    I can find the layer I need to manipulate with ' this .getOCGs () [0] ", the layer I need to handle reaches zero and using the"Merge layers"example in the Guide scripts JavaScript Acrobat a layers properties are modified to match the target layer but it always appears as a distinct physical layer.

    What I just wrote is unable to make sense of bones of bunch so in other words... What I want to do with javascript, it is the action of the "Import under the layer" option selected in the layers panel in mirror. The function key I want to make is in the 'Options of Import' is to 'add to the existing layer.

    I appreciate any help that can be offered.

    JT

    There is much that can be done with JavaScript in Acrobat.
    As far as I know, you can add or merge a layer directly, but you can add a BCG with the addWatermarkFromFile() method.

    About the console, simply run your code and either select the name of the variable you want to examine or type it, and then press Ctrl + Enter. It displays its value. For example, if you run this code:
    var a = 2 + 5;
    one;

    The result will be "7".

  • Is there a way to change the color layer tag via the Script?

    I tried to use the listener from Script to find the event to change the color of the layer tag, but there is no order saved on my desktop. I've scoured the forums and the depths of huge... ooogle and nothing is helping.

    I checked the API for an Art Layer and found no option to assign a color label.

    I want to change the color tag of the:

    Capture.JPG

    The purple color of the tag:

    Capture2.JPG

    Could someone please help point me in the right Direction?

    Just solved my own question:

    Photoshop has been weird so I had to change the color 2 times for the event must be recognized... idk why but it worked: here is the code:

    desc66.putReference (idnull, ref55);

    idT var = charIDToTypeID ("T");

    var desc67 = new ActionDescriptor();

    var idClr = charIDToTypeID ("Clr");

    var idClr = charIDToTypeID ("Clr");

    var idVlt = charIDToTypeID ("Vlt");

    desc67.putEnumerated (idClr, idClr, idVlt);

    var idLyr = charIDToTypeID ("Lyr");

    desc66.putObject (idT, idLyr, desc67);

    executeAction (idsetd, desc66, DialogModes.NO);

  • Create the top layer with transparency

    Hi all

    I created a SWF for the header of my site. On the top layer, I have an image that remains static, while the rest of the header changes images. I try to get the static image to be fairly transparent but am not having much luck. PS I recorded it with transparency, I created the image, but it doesn't seem right in the swf file.

    Any suggestions?

    Thanks in advance

    Chris

    When registering for the web of the PS use PNG24.

  • Bug? Can change the color chart with the arrow keys?

    I used the option live paint and live paint bucket.  It's really handy change shade that I use by using the left and right arrow keys to change my swatch in the Swatch Palette.  But in CS6, if I do, and the next shade chosen is a percentage of shade of another color (for example, I have a shade of blue and a shade of blue 85%, which is the tinited Swatch blue to 85% in the color palette and then transformed to a saved shade), the 'selection' around the shade box disappears and I can change is no longer the choice of grade without clicking above.

    I can switch easily between shades that are not percentages of the original, without any problem.  CS5 and all earlier versions that had this feature had no problem whatsoever.

    Huh?

    The fixed.

    Removed preference files.  Works fine now.

    Mac HD > users > Home > library > Preferences > Adobe Illustrator CS6 settings > en_US > Adobe Illustrator Prefs

  • release all transparent strokes on a layer with javascript

    Hi all!

    I'm doing a script that converts groupitems pathitems on a layer. I found a script here, which dissociates to group items in a layer.

    var thisDoc = app.activeDocument;

    myLayer var = app.activeDocument.activeLayer;

    Var thisDoc.activeLayer.groupItems = group;

    for (d = 0; d < group.length; d ++) {}

    var mygroups = Group [d];

    for (i = mygroups.pageItems.length - 1; i > = 0; i--)

    mygroups.pageItems [i] .move (myLayer, ElementPlacement.PLACEATBEGINNING);

    }

    Is there a way to also release traces transparent in the group items so that they become individual pathItems as well?

    Thank you

    It's what you want.

    function test(){
    
        function dismantle(group){
            var prnt = group.parent;
            var cont = (group.typename == 'CompoundPathItem') ? "pathItems" : "pageItems";
            var insertIdx = (function(){
                var ln = prnt.pageItems.length;
                for(var i=0; i-1; i--){
                var item = group[cont][i];
                item.move(insertIdx, ElementPlacement.PLACEAFTER);
            }
        }
    
        function breakUpLayer(layer){
            while(layer.groupItems.length>0 || layer.compoundPathItems.length>0){
                var groupIdx = layer.groupItems.length-1;
                while(groupIdx>-1){
                    dismantle(layer.groupItems[groupIdx]);
                    groupIdx--;
                }
    
                var compIdx = layer.compoundPathItems.length-1;
                while(compIdx>-1){
                    dismantle(layer.compoundPathItems[compIdx]);
                    compIdx--;
                }
    
                redraw(); //hate to do this, but items.lengths do not update otherwise.
            }
        }
    
        if(app == "[Application Adobe Illustrator]" && app.documents.length>0){
            var doc=app.activeDocument;
            var firstLr = doc.layers[0];
    
            breakUpLayer(firstLr);
        }
    }
    
    test();
    

    I think the only problem you might encounter is the eccentric way Illustrator allows groups inside the CompoundPaths.  Crazy, no, because CompoundPathItem is not a property GroupShapes or PageItems, if you can get them using the method above.  In fact, it can get stuck in an infinite loop when it is like that!
    Really, this problem must be pretty RARE because nobody should be groups into transparent paths.  But for safety it is best connected the ETSK, then you can stop debugging, if such a problem occurs.  You can also build a security counter to get out you of the loop.  What a freak!

  • Jagged edges because of the colors oversaturated with XDCAM EX

    Hello

    I want to export a movie created in sequels like XDCAM EX 1080i50. My problem is that I get the edges cut in the output file because of the oversaturated color im using in my After Effects composition. In the image below you can see the star with the magenta color that has jagged edges. I don't have this problem with the yellow. Is there a color matrix supported XDCAM EX or another solution for this problem?

    Bildschirmfoto 2012-03-18 um 22.25.51.png

    Don't think that this has nothing to do with the saturation. The CoDec could manage this, in any case. Rather what I see, it's simply an unfavorable angle combined with two colors being close to each other that represent two extreme opposites of the YCbCr color space. There may be some odd scaling, in addition, cause softening, but in itself, there is nothing wrong in what the chosen output format can or cannot do. Of course, it can for example be improved by selecting slightly different colors and slightly different angles, but you will still have to comkpromise due to compression.

    Mylenium

  • Catch the inevitable back with Javascript

    Is it possible to catch the back key pressed event? I found the link by using the Widget API, would continue to operate the javascript even when I'm not using this api? My pure html code & javascript, is there another way to do it?

    Are you looking for to attempt to capture the back press on in the general browser and not in a widget?

    You can only intercept the key precedent by using JavaScript in a Widget/WebWorks application using the API in the link you posted.  There is no way to do this in the browser in general.

  • Definition of the XMP data with inconsistent results

    $. pipelineTools.MetadataController.prototype.setMediaStartTimecode = {function (timecode)}

    var path = "Column.Intrinsic.MediaStart".

    Test

    Val = this.xmpMetadata.setStructField)

    XMPConst.NS_DM,

    "startTimecode,"

    XMPConst.NS_DM,

    'timeValue ',.

    '00:00:00:00 '.

    )

    this.xmpMetaChanges.push (path)

        // " http://ns.Adobe.com/XMP/1.0/DynamicMedia/ "

    var val = this.xmpMetadata.setStructField)

    XMPConst.NS_DM,

    "altTimecode,"

    XMPConst.NS_DM,

    'timeValue ',.

    timecode

    )

    this.xmpMetaChanges.push (path)

    }

    He always pays in ESTK correct timecode, but it is not always set the same value.

    As you can see in ESTK:

    However, the clips at random are preparing to 00:00:00:00

    There is a logic to the way in which metadata are drawn? I tried to make sure that there is a field startTimecode first (because sometimes this field does not exist in some cases completely and must be created), but it doesn't matter. Alttimecode is the one we want to use because it is the lag that we use for the potential for additional images being made at some point.

    Above is a clip that was supposed to have MediaStart the 00:00:04:05 value and this is a clip that was correctly configured value:

    The two using the same code, the same calculation, the same session.

    Seems to be incompatible and dumping the XMP files results in this:

    grw020 (Successful):

    < xmpDM:startTimecode rdf:parseType = "Resource" >

    < xmpDM:timeFormat > 24Timecode < / xmpDM:timeFormat >

    < xmpDM:timeValue > 00:00:00:00 < / xmpDM:timeValue >

    < / xmpDM:startTimecode >

    < xmpDM:altTimecode rdf:parseType = "Resource" >

    < xmpDM:timeValue > 00:00:04:05 < / xmpDM:timeValue >

    < xmpDM:timeFormat > 24Timecode < / xmpDM:timeFormat >

    < / xmpDM:altTimecode >

    soc020 (qualifications):

    < xmpDM:altTimecode rdf:parseType = "Resource" >

    < xmpDM:timeValue > 00:00:04:05 < / xmpDM:timeValue >

    < / xmpDM:altTimecode >

    < xmpDM:startTimecode rdf:parseType = "Resource" >

    < xmpDM:timeValue > 00:00:00:00 < / xmpDM:timeValue >

    < / xmpDM:startTimecode >


    As you can see, grw020 somehow magically Gets the timeFormat string and using the same code in the same session, soc020 not get the timeFormat value.
    Now I'm curious to know how the successful clip becomes the value lost, and secondly - why is it fill properly? There is a sequence to 23.976 and it is filling with 24Timecode - when it should be filling with 23976Timecode as I have seen in other clips.

    Overall, this seems to be a very inconsistent data set.

    Thank you.

    I don't think that it is possible to set the framerate on a clip using XMP metadata project and first noticing the change. I am successfully able to change the startTimecode, altTimecode and other values, but if I put the XMP value or project metadata, there is no change in framerate.

    It seems that for a period indeterminate media Timebase will replace all attempts to set the framerate, even if the correct and desired information are in the XMP output and the metadata project out after importation.

    I test this by setting the Timebase of media for an indefinite period to 59,97 fps and import a clip with no metadata on it.

    Once this process is complete, waiting for the event loop complete the import and then try to set the framerate to 23.976 both XMP and metadata to the project. It does not change. However, all other values will not change.

  • How to activate the layer above the current layer with the keyboard shortcut?

    He spent 30 minutes of google and I have not found the solution.

    How can I activate the layer above / below the current active layer?

    Photoshop CC 2014

    European keyboard

    English version of Photoshop

    Windows and Mac

    I tried alt and alt + 0, 9 on Windows, but it doesn't work.

    Thank you

    It's here: Dropbox - move a Layer.atn

Maybe you are looking for