Path stroke color

i tried many time  stoke color in pathitem
example)
pathitem.strokecolor = strokecolor( 0, 30 ,0 );
right ?
hum   very difficult

You are doing the same as in your last post… JavaScript properties are case sensitive that and you need to define your color properly… or is that VB as I would know?
#target illustrator
changeStrokeColor();
function changeStrokeColor() {
          var  doc = app.activeDocument;
          var newRGB = new RGBColor();
          newRGB.red = 0, newRGB.green = 255, newRGB.blue = 0;
          doc.pathItems[0].strokeColor = newRGB;
          app.redraw();
Presuming an open document (rgb) and a path that is stroked…

Similar Messages

  • PATH CONTROL?  Selection of, changing fill and stroke colors, moving & arranging?  WHEN

    When is "Ideas" going to have BASIC, vector and path controls??? 
    The ability to select, move and arrange individual paths? 
    The ability to fill and change stroke colors?
    Shape tools?
    I would've expected this from the start.  This is not 1988 all over again... or is it?
    And what's this racket with "layers"?  You charge a premium for the app and then want people to pay again for simple features?  Layers would be less important if the app could do what it should to begin with. 

    Hi Mark,
    Please post ideas for improvements using the Submit an Idea button, please post each idea as a separate thread, this is so others can vote on the idea if they had the same one or like the idea, The product team reviews these when considering what features to add.
    I'm not really sure why Adobe has the option for additional layers as an in app purchase but you could create an idea post to request this changed as well.
    -Dave

  • How can I apply a current fill color to a stroke, then adjust that stroke color's build?

    Hi all, I'm trying to figure out a way to automate a simple, yet repetative process I do countless times a day. Ideally, I'd like to tie it to a keystroke to speed up my workflow.
    I work on line art and colorways for footwear, so the way I'm coloring these shapes and strokes helps to break apart the different materials and pieces of the shoe.
    While coloring line art, I work with Pantone spot colors as fills for closed path objects. I then have to manually apply that same color to the stroke, set the stroke to 0.5px weight, convert that spot stroke color to CMYK, and add 15% to the K value.
    I found some code in an older post for applying the actively selected object's fill color to the stroke, but I'm having but I'm having trouble with the next step of figuring out how to take that spot stroke color and convert it to a CMYK build that I can then add 15% black to. Is this something that's even possible? I've spent about an hour playing with the script and have only had luck matching the fill color or turning the stroke white. Thanks for the help!

    ok try this one, I added the spot color option
    // make stroke color same as fill color + 15% black increase
    if ( app.documents.length > 0 && app.activeDocument.pathItems.length > 0) {
        for (var a=0; a<app.selection.length; a++) {
            try {
                    var sel = app.selection[a];
                    var fillcolor = sel.fillColor;
                    if (fillcolor.typename == "CMYKColor")
                        var cmkycolor = fillcolor;
                    else if (fillcolor.typename == "SpotColor")
                        var cmkycolor = fillcolor.spot.color;
                    var col = new CMYKColor;
                    col.cyan = cmkycolor.cyan;
                    col.magenta = cmkycolor.magenta;
                    col.yellow = cmkycolor.yellow;
                    var black = cmkycolor.black + cmkycolor.black +15;
                    col.black = black>100 ? 100 : black;
                    sel.strokeColor = col;
                    sel.strokeWidth = 0.5;
            catch (e){alert(e)

  • How to set fill, stroke & color to a group

    First of all, I must say I'm a complete beginner in Javascript so please have patience with me.
    What I'm trying to do is to set a lot of groups to specific fill, stroke & color using a function.
    var docRef = app.activeDocument;
    var Reg = docRef.swatches["[Registration]"].color;
    var mm = 2.834645;
    var lineWidth=0.12*mm;
    group1.stroked=true;
    group1.strokeColor = Reg;
    group1.filled = false;
    group1.strokeWidth = lineWidth;
    This works, but I have to this for every group and there are lots of them.
    So I tried to make a function:
    function setAttributes(temp)
    temp.stroked=true;
    temp.strokeColor = Reg;
    temp.filled = false;
    temp.strokeWidth = lineWidth;
    And then call that function for each group:
    setAttributes(group1);
    setAttributes(group2);
    setAttributes(group3);
    etc.
    Of course, this doesn't work since I have incredible programming skills
    Please help.
    Thanks!

    The script as it is should ONLY change the path items that are in your 'first level' of group items… If you need to change the properties of path items outside of the groups then you could add another loop… Heres one way you add the extra loop:
    var docRef = app.activeDocument;
    // Set variable to your color
    var reg = docRef.swatches.getByName("[Registration]");
    // Set a variable to the document path items collection
    var pathList = docRef.pathItems;
    // Loop through this list of objects
    for (var h = 0; h < pathList.length; h++)     {
         // Change the property values
         pathList[h].filled = false;
         pathList[h].stroked = true;
         pathList[h].strokeColor = reg.color;
         pathList[h].strokeWidth = 2;
    // Set a variable to the document groups collection
    var groupList = docRef.groupItems;
    // Loop through this list of objects
    for (var i = 0; i < groupList.length; i++)     {
         // Re-use variable for the groups path items collection
         pathList = groupList[i].pathItems;
         // Loop through this list of objects
         for (var j = 0; j < pathList.length; j++)     {
              // Change the property values
              pathList[j].filled = false;
              pathList[j].stroked = true;
              pathList[j].strokeColor = reg.color;
              pathList[j].strokeWidth = 2;
    app.redraw();

  • How do I auto set stroke weight, stroke colors & fill color?

    Hi,
    I'd like to make it easier for our 100,000 designers to use AI to make custom products using a laser cutter.
    Current Practice
    Designers open our AI laser cutting design templates, add their designs using the AI settings our online pricing system can read, then upload their designs to our website for instant pricing, making and shipping.
    The Problem
    Designers have to manually setup AI with settings that can be read by our online pricing system. If they get these settings wrong, our system can not read their designs. So they are rejected and can not be priced or made. This happens more often that you'd imagine.
    The Solution
    Designers do not like design rejections. So I'd like to eradicate them by providing our designers with a version of AI that provides the following settings only:
    * Set document to RGB
    * Stroke weight = 0.01mm
    * Stroke colors = RGB 0, 0, 255 and 255, 0, 0
    * Fill color = RGB 0, 0, 0
    This will mean designers have a very limited number of AI choices, with nothing to distract them or to get wrong. Which will result in less (or zero?) design rejections. And products made faster than before. Rejoice!
    Question
    How do we program our AI laser cutting design templates so that when they are opened in AI, they auto set AI settings as defined above?
    Thanks so much.
    Derek

    Ponoko wrote:
    Your first point - yes, that's what our system does currently. As a result designers get lots of 'how to fix' messages as a result of design rejections. We wish to reduce these rejections and resulting 'how to fix' messages by limiting their choices in AI - because this is where the problems are created.
    Ok, yeah gotcha, so customers/designers think they do it right (cough/laugh) upload, then get surprised to find out they didn't by your upload system. That's kind of what I thought. I feel your pain. ;-) I sense you want to reduce this aspect to keep the customers/designers happy and thinking they do nothing but work magic all day right? ;-) So you don't want to lose customers in the midst of frustration of file rejection thinking there files are right and your system is certainly wrong, when in fact it's the opposite. Good luck explaining that to a designer however, right? ;-)
    Ponoko wrote:
    Your second point - You go on to talk about using a complex "action" we could distribute within the design templates. Although I suspect this is different, the path we're thinking is to include something in the templates that, when imported into AI, sets AI with the color palette we need, line weight we need. Possible?
    As Monika hinted at you can't rigidly restrict or control what a user is allowed to do and use in Illustrator. You can try to reduce the parameters by saving the file as a Template.ait file, but even then they can muck about all day until they mess things up again, plus you have no control whatsoever even then as to whether they use fills, the stroke weights, etc. That is why I mentioned various things to manipulate the file once they deem it completed and ready to submit/upload. Basically a method to fix what they messed up or did incorrectly and instead set things as they should be for submission as I previously mentioned. I mentioned you may be able to create a complex Illustrator "action" action.aia that they run to process these requirements. I am not sure if such an action could be accomplished as all inclusive (perhaps though) otherwise you could as stated do it through scripting and a script they run: script.jsx to prepare the requirements, or an actual standalone helper app you create and provide like I mentioned above as well.
    I see for CorelDRAW & Inkscape you require SVG, why not change that for Illustrator also so all your 2D app submissions are SVG based? Then manipulate the SVG server side, point out the changes and why and have the customer approve the new modified SVG Preview of the needed changes and move along with the process from there? Make all the requirement changes on the server by manipulating the SVG. You should have access to all of the requirements: RGB color model, stroke weight, stroke colors, fill colors, create font outlines, image tracing? I am just tossing out ideas here, get your programmers busy, tell them to stop playing video games and "make it so". ;-)
    But even so, this then begs the question: What are you doing to circumvent the same issues for inept CorelDraw and Inkscape users?
    Since, they have the same freedom to do things incorrectly and misaligned with the requirements, just as Illustrator users do.
    Regardless though of the approach customers/designers may not like seeing certain things changed even minutely in trivial amounts and thusly be just as upset or up in arms with the changes to their pretty design files that they think were not needed in the first place, how dare you undermine them ;-). Same as seeing the file rejection from your system upon upload. Again I feel your pain. You have your Application/File requirements requirements stated nicely and plainly, it should be pretty easy for most, but sadly I guess not.

  • Script to select same stroke color and apply a new swatch...

    I am trying to write a script that will select a line based on a swatch name, apply a new swatch, set the stroke, dash and miter of the line...and then create a new layer, change then name of the layer, and then move the selected items to the newly created layer.
    All I could seem to accomplish was renaming a swatch.
    var swatchName = app.activeDocument.swatches;
    if (swatchName.length > 0) {
        for (i=0; i < swatchName.length; i++){  
            changeName(swatchName[i]);
    function changeName(swatchObject){
                     if (swatchObject.name == "PANTONE Orange 021 C"){                     
                        swatchObject.name = "021 (Orange)";
                    if (swatchObject.name == "PANTONE Red 032 C"){                     
                        swatchObject.name = "032 (Red)";
    So the goal of what I would like it to do is look for all paths with the stroke color set to "PANTONE Orange 021 C" then have it change the swatch name to "021 (Orange)". After that apply the stroke, dash and miter. Create a new layer named "021 (Orange)". Then send all of the selected lines to that layer.
    PLEASE HELP AS I HAVE 200+ files to do this task to. Using a windows machine with CS3. Trying to write in javascript.

    This would be the way to rename 2 existing swatches… The GUI pallet can be a little sticky in updating but it works…
    #target illustrator
    var docRef = app.activeDocument;
    var a = docRef.swatches.getByName('PANTONE Orange 021 C');
    a.name = '021 (Orange)';
    var b = docRef.swatches.getByName('PANTONE Red 032 C');
    b.name = '032 (Red)';
    redraw();
    My mistake… Looks like this Jive stuff gave you an unwanted bump from nowhere? Didn't look at the date…

  • Can't change the weight of my strokes, color or fill...

    I use artioscad wich has a plug-in for illustrator. When I'm working with illustrator i can't change the weight of my strokes, color or fill, in fact i can't do anything, everything is locked. I have tried to unlock the draw but with n o sucessm can anyone help me?? I have to make the illustrations for the boxes I draw and using *.eps file is not my solution.

    Hi Megan,
    Thanks for the replay.
    I have tried many thinks, and tried what you wrote, but nothing. I'm new in this artioscad-illustrator, so probably I'm making something wrong. I just draw in artios and open directly in illustrator using esko plug-in.
    I tried again what to told me to trie but with no luck.
    I'll pass you a step-by-step what I made after oppening in illustrator:
    I'll make my steps for you to undersatnd whats hapening.. because I have tried looking the appearance palette.. and its ok.
    First i draw in artios, its a package software design which has a plug-in for illustrator (to open directly artios drawings in illustrator)
    Then in illustrator i open it directly, the aspect is like this:
    I unlock the chain of the layers and in the appearence palette apears just plug-in object.
    I can select an individual path but can't change it. If I make a offset path with 0mm, I can change that path weight but not the original. But if i try to move the offset path or the original path it gives me an error "Can't move the objects. The command was canceled"
    I have tried so many things that, realy, I can't remember all. I
    have a menu that has more options, but none of them unlock the paths. Every time try to drag an anchor it goes right back to the original position.
    The goal is to make something like the next image:
    Today I dupplicated my layer and then made a offset 0, now I can change the weight, color and fill my shape. Probably I will find more problens in the way. This was the only solution that worked with me!

  • Vector path stroke

    I have a path drawn which I stroked. However, this stroke is raster and I really need a vector line to be drawn instead. How can I create a vector path stroke?

    With your Path active, add a Solid Color Fill Layer, and add a Layer Style with Stroke enabled and the Fill set to zero.
    Note that this will only work if you are dealing with closed paths, like an elipse or recangle. If the paths are open, Layer Styles Stroke acts as if they are closed. If your paths are open, you really need Illustrator to keep the strokes vector.

  • Help with stroke color

    I'm working with Sketchup exports and every time I export a model as a vector and import into Illustrator, all my lines show up different colors...
    OK so no problem, I should just be able to alter the stroke color of all these lines, right?
    So I select all the paths I want to change the stroke color of and the message in the stroke appearance box says "mixed appearances" and there doesn't appear to be any option to change stroke color, yet I can change corner types and stroke point size....
    Certainly there is a way to do this, without having to go through and select each and every single line!!
    Thanks

    acresofgreen wrote:
    I just noticed however, that in the screenshot you provided, the Fill Box was active and not the Stroke Box.  To my knowledge, you can't change the stroke color unless the Stroke Box is active.
    you're correct that is the only reason they cannot change the color of the strokes. If the use the appearance panel that might be a different story unless they select objects with the same appearance and not one that is mixed. Like apples and oranges the same but different.

  • Problem with stroke color and weight

    I have an illustration of a chair I am working on using Illustrator CC.  It is made up of a combination of shapes and open paths.  In order to get the illustration filled correctly I used live paint to fill the open paths.  I was in the process of adjusting the stroke weight and colors but one stroke will not allow me to make any changes.  The stroke color is marked witha  question mark and the weight will not change at all.
    Update:  I have since posting this copied my artwork and pasted it into a new document.  I was able to correct the stroke on the problem path, but now there is an entire section of the chair which will accept no fill...
    Any help is appreciated.

    If I were you I would provide a sample .ai file and include some instructions to reproduce the issue you're talking about.

  • How to find out the textframe contains "stroke color" (or) "fillcolor"?

    How to find out the textframe contains "stroke color" (or) "fillcolor" via javascript. Kindly advise me with sample.

    I know, this post is quite a while ago, but: This simply does not work for me. Neither for simple PathItems, nor for the characters of a TextFrame.
    Working on: Illustrator CS5.5, Mac OS, Javascript
    Simple example:
    var numSelectedObjects = app.activeDocument.selection.length;
    // If any objects selected: Get fill and stroke color of the first one
    if(numSelectedObjects > 0){
    alert("Fill Color: " + app.activeDocument.selection[0].fillColor + " / Stroke Color: " + app.activeDocument.selection[0].fillColor);
    This returns always CMYKColor, RGBColor or GrayColor, even if there is no Color assigned to the objects stroke or fill!!
    For PathItems there is the attribute ".filled" or ".stroked", which returns "true" or "false" and is reliable.
    if(app.activeDocument.selection[i].filled){ // works fine with PathItems!
    Is there anything similar for Characters? I tried this one, but it does not work (because I think it does not exist):
    if(app.activeDocument.selection[i].textRange.filled){ // does not work!
    I just need to find out, if the characters in a textfield have got a fill or stroke color. Reliable.
    It would be very nice to get help from anybody!
    Thanks a lot in advance!

  • PS CS6: stroke color picker preview in real time not working

    re: NEW color picker stroke color not updating in real time (previewing).
    Is it me or has the stroke color preview been removed in CS6 or is there a setting that needs to be changed to enable it?
    The problem: When I create a shape layer, press enter and then chose a stroke color from the color picker, I select a color but it doesnt update the stroke color until I press enter. I'm sure it used to change in real time as you clicked on the color picker panel before accepting it.
    Any sugestions or ideas as to whats going on or am I going mad?
    Further update: This is when creating a shape but using the new stroke feature in the properties bar at the top (the one which gives you the new fancy options like having a dashed, transparent or gradiented stroke) and not the traditional method of adding it as an effect. This still shows a real time update, but the new method doesnt.

    Curt Y wrote:
    zarrdave wrote:
    You're then moving the colour picker dialogue box to one side so you can see he shape created, and you've then tried clicking on different colours and the border color has changed after each click (but before you press OK)?
    If thats working so the color changes in real time for you, then unfortunatley I've got a problem with my version.
    Using Win7 CS6 extended, and following your instructions it works for me.
    Border changes withn I click on color pallet with color picker.
    Odd, same version/ O.S. here, thanks for that though Curt Y. Are you sure you're not clicking on the preset colours and actually using the color picker dialogue box.
    I've been in a bit of a rush here at the office and appologise for not being clearer and posting a screencap earlier.
    To clarify, its the Cyan dialogue box not the orange box I'm talking about  (nice choice of colours I know ). The top right icon in the organge box with the colours in is how you get to it.

  • How to change Object Stroke Color and fill Color?

    Hi to all
    i need to change fillcolor & stroke color of Object
    here i wrote code that tried but it is not
    myDoc = app.activeDocument;
    var dd = myDoc.colors.add({name:"PANTONE Black C", model:ColorModel.spot, colorValue:[0, 13, 49, 98]});
    app.findObjectPreferences= NothingEnum.NOTHING;
      app.changeObjectPreferences = NothingEnum.NOTHING;
      app.findObjectPreferences.fillColor = "Black";
      var myI1 = myDoc.findObject();   
       app.changeObjectPreferences.fillColor = "PANTONE Black C // here error throwing
        app.changeObject ();
    app.findObjectPreferences= NothingEnum.NOTHING;
      app.changeObjectPreferences = NothingEnum.NOTHING;
      app.findObjectPreferences.strokeColor = "Black";
      var myI2 = myDoc.findObject();   
       app.changeObjectPreferences.strokeColor = "PANTONE Black C // here error throwing
        app.changeObject ();
    Error is :  Invalid value for set property 'fillcolor' ,Expected Swatch, String or NothingEnum enumerator, but received "PANTONE Black C";
    pls help me...
    Thanks
    Thangaraj

    Hi scriptor,
    how to create find change query for object search
    pls tell me with script.
    here i attached one jpg file screen shot to understand my need
    Thanks
    Thangaraj

  • Why do you need to shift click to select stroke color with eyedropper tool?

    Hi,
    Quick question..
    Why do you need to shift click to select the stroke color with the eyedropper tool?
    I had the problem where I could not do this earlier and found the solution on this forum.
    However I still do not understand the reason for this.
    Appreciate if anyone could explain it to me.
    Thanks in advance.
    Nori

    Hi, Nori,
    If you have the red and blue rectangle selected and the Fill square selected in the tool panel, as at bottom left, then hold the shift key down and click with the eyedropper on the green stroke in the upper rectangle, then the red fill will turn green but the stroke stays blue. If you select Stroke, as at bottom right, then shift-click with the eyedropper on the green stroke, the blue stroke will turn green but the fill stays red. With Fill selected and shift-click on the yellow fill, the red fill turns yellow; with Stroke selected the blue stroke turns yellow. If you do not depress the shift key, the red and blue rectangle will become yellow and green.
    It's complicated to explain, but I think that if you try it step by step it will make sense to you.
    Peter

  • Select same fill color/stroke color but not for entire document

    As the title imply's, I am wondering if there is a way to use the "select same fill color" and/or "stroke color" for just a group of objects in a document as opposed to document-wide.
    Thanks for any help you can provide!
    Tony

    Did you make the group into an isolation group?
    ( in the Control bar.)
    Or else you can select the objects you want to change, then Select Inverse and lock or hide.
    Isolation groups are usually handy for this kind of work though.

Maybe you are looking for

  • Ipod not recognized by computers or itunes

    I have not been able to view my ipod in itunes for months now. When I plug it into my computer, it is recognized as a USB storage device that is unformatted, not as an ipod. I have tried it in all the USB ports and on multiple computers, and I know i

  • How to get SD Document Category

    Hello Friends, I am not a functional guy and so am having problem in knowing how SD Document Category is related to a customer. I have details like customer, sales organization, distribution channel, division inco terms etc., I have to create a quote

  • Restore backups from Server 2012 Standard to 2012 Essentials or Foundations

    The owner of our small office (about 25 employees) wants to have an off-site "emergency server" to be used if the primary office becomes completely unavailable due to fire or other emergency. In the past we did this with a 2003 Small Business server

  • ABAP WD application -Adobe form -Cache problem

    Hi, I have an WD application where -in user enters order number  and clicks search button then it displays order as adobe form. I am having problem with cache! at first if there is a order which has all item data it displays that order properly but i

  • Send to: Changing default texts/system-url for emails

    Hi, I would like to change the default texts for emails send by "Send to". The specific problem is, that the system-url in the link to the object isn't correct. for example: http://testsystem... instead of http://productive... Have you got any ideas