Illustrator Scripting :: Change Stroke Color Of Object In A Script?
Nov 26, 2012
I need the finished script to create a rectangle with no fill and a 20% gray stroke to outline each artboard. I dug this up off these boards, which works perfectly except the rectangles created have no fill or stroke. certainly save me a lot of time drawing rectangles on a daily basis.
#target illustrator
var docRef = app.activeDocument;
var artboardRef = docRef.artboards;
for(i=0;i<artboardRef.length;i++){
var top=artboardRef[i].artboardRect[1] ;
var left=artboardRef[i].artboardRect[0];
var width=artboardRef[i].artboardRect[2]-artboardRef[i].artboardRect[0];
var height=artboardRef[i].artboardRect[1]-artboardRef[i].artboardRect[3];
var rect = docRef.pathItems.rectangle (top, left, width, height);
rect.fillColor = rect.strokeColor = new NoColor();
}
View 3 Replies
ADVERTISEMENT
Apr 9, 2013
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 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.
View 13 Replies
View Related
Aug 8, 2013
Select same fill color with java script and stroke color tool.
View 1 Replies
View Related
Jul 5, 2011
How to find out the textframe contains "stroke color" (or) "fillcolor" via javascript. Any sample.
View 5 Replies
View Related
Aug 10, 2012
Is there a way to select similar objects (by stroke color) programatically?
View 3 Replies
View Related
Jan 6, 2013
I have a question regarding illustrator. Let's say I have a circle with blue fill and red stroke. And I place an image in the illustrator file. Now I want to change the red stroke of my circle to let's say a purple color by sampling the color from the image.
How can I achieve that with a eye dropper tool? Every time when I try to sample a color from the image, the whole circle will change to purple instead of just the stroke? I have tried multiple key combination, shift, alt, ctrl but they all don't work.
View 7 Replies
View Related
May 30, 2013
When I run the script for an object selection, I want each object to have its color set to the underlying color as if I had used the eyedropper tool. Is this something that can be scripted?
View 1 Replies
View Related
Feb 6, 2013
I am trying to change the color of all items on and under a specific layer.I have been successful changing the color of specific types of objects (paths), but I need to accommodate all the types on the layer and sub layers.
I can recurse to as many sub layers as I expect, but how do I accommodate the page Items, path Items, group Items, compound Path Items, etc.I was thinking of pushing everything to an array, but I have no experience with arrays...
View 3 Replies
View Related
Mar 2, 2012
Almost every time I add a linear gradient to an object I want to change the angle from 0 to 90 degrees.
Is there a script that I could use for this, so that I could assign a keyboard shortcut and press that instead of clicking the box & typing 90 all the time? (i.e. select an object, run a script & it would apply the standard black to white linear gradient at 90 degrees instead of 0.)
View 5 Replies
View Related
Feb 4, 2013
I managed to write this javascript. It automatically changes the colors from one swatch (byName) to another (byName) in my opened illustrator file. But if this one color doesn't exist as a fill or outline color in a file, I get an error message, because the script can not detect the color. The script stops. I am working on a batch of Illustrator files with 3 colors to change, but some files contain just 1 or 2 of the colors.Is there a command for javascript which says: "Only change the color, if the color appears"?
Here is the script:
var docRef = app.activeDocument;
with (docRef) {
var findColor = swatches.getByName('TSB Dark Blue').color;
var replaceColor = swatches.getByName('TSBDB').color;
[code]....
View 2 Replies
View Related
May 4, 2012
I want to overprint a PMS colors using Applescript. I though if I changed the property of the selected items fill color from (fill overprint:false) to (fill overprint:true) it would work. This doesn't seem to change a thing.
This is the script I am currently using:
script ChangeOverprint
tell application "Adobe Illustrator"
local docRef
[Code]....
This is the picture of a simple document I created. The elipse has fill overprint:true. The polygon has filr overprint:false. The original value for the property fill overprint was false. I changed it in the script to true. Which the log shows it changed.
View 1 Replies
View Related
Jun 6, 2012
I am trying to create a script who could act as an Autocad plot (ie convert each color to black, with a different line weight).
Here is the first script I melted, who create my Black swatch
if ( app.documents.length > 0 ) {
var myDoc = app.activeDocument;
//add Black swatch
var newSwatch = app.activeDocument.swatches.add()
var newColor = new GrayColor();
newColor.gray = 100;
[Code] .........
And here is the second one, who replace one color by Black (it don't change the text, nor the lineweight yet…
if ( app.documents.length > 0 ) {
//test de dialogue
function csDialog() {
var fabGroup = app.activeDocument.swatchGroups.getByName('Fabrics');
var allFabs = fabGroup.getAllSwatches();
var fabNames = Array();
[Code] ........
View 2 Replies
View Related
Mar 20, 2012
I have a couple thousand AI authored EPS files with a specific swatch name (SpotBlack) that I would like to rename (black) -- is there any method to do this en masse, preferrably outside of Illy using a text editor?
View 7 Replies
View Related
Mar 3, 2013
Okay my script to change text frame color changes the color of all text frames hidden or not.
I need it to only change visible text frames.
if ( app.documents.length > 0 ) {
newCMYKColor = new CMYKColor();
newCMYKColor.black = 0;
newCMYKColor.cyan = 0;
newCMYKColor.magenta = 0;
newCMYKColor.yellow = 0;
[Code]...
How to go about making it only change the color of text frames on the active layer? In the final script I will hide all other layers so if it could be done by a visible attribute more easily that would work just as well.
View 4 Replies
View Related
Apr 2, 2013
I'm trying to create a script in CS5 mac os10.6.8 that will change the fill color of selected pathItems. I need a simple script that will change a selected pathItem to cmyk values 2,3,15,0. I will then select this script and implement the action in a batch of 600 files.
I wish this process could be recorded as an action but when I record the action "add new swatch" I have to manually input the cmyk values, which will take forever for a batch of over 600 files.
View 15 Replies
View Related
Jun 6, 2013
Is there a way to export a document @ a different resolution than 72DPI? I know I can set the horizontal/vertical scale to save it at a larger dimension at 72DPI, but I need the file to be actual size and 300DPI.
This is part of a larger process, and I'd prefer to do the entire process from Illustrator, and not have to open the files in Photoshop to change the size/resolution.
Also, is it possible to change the color mode to CMYK or Greyscale for the exported Jpeg?
View 7 Replies
View Related
Mar 16, 2013
the Script of creating mirror text and stroke text in Adobe illustrator scripting.
View 4 Replies
View Related
Oct 30, 2012
I bought an image from shutterstocks... But when I change a colour, it all turns in monochrome colour. My Ai (CS6) knowledge is very limited, so I do not know what to Google "How to..."
I would say that in a moment I change colour Ai understands that I colour in borders and all lines overlaps each other... However, I do not colour borders...
Image is very complex pattern and I believe it is somehow related with image production... The image does not appear as it looks like - everything is over layered with cut-outs of object above... But it is beyond my knowledge...
I have tried to ungroup but with same results... How to manipulate this image?
View 8 Replies
View Related
Jan 21, 2013
I'm trying to set the stroke style for a path item I've drawn through JavaScript, however I can't find a way to set the stroke alignment for my path item.
I've checked the Illustrator JavaScript reference but I can't seem to find that option in there.I would expect something like:
pathItem.strokeAlignment = StrokeAlignment.OUTSIDE; // This doesn't work, what is the correct way to set the stroke alignment from JavaScript?
If I change the option in the Actions Panel it comes up as 'Set Stroke/Alignment: Outside', so there must be an equivalent way of setting it from JavaScript. Is there a way of converting Actions to JavaScript so you can see which properties and attributes are being set on the object? What is the correct way to set the strok alignment from JavaScript?
View 5 Replies
View Related
Sep 12, 2012
does the document have a property that can be set to true or false for scale stroke? I didn't see it in the documentation, maybe there is another way?
View 1 Replies
View Related
Jan 10, 2014
So here's what I wrote to try and find and delete all pathItems within a document that lack a fill and lack a stroke.
var doc = app.activeDocument;
for (i=0; doc.pathItems.length>i;i++) {
alert(doc.pathItems[i].name + " " + doc.pathItems[i].fillColor.name)
[Code]....
But alas, neither seems to do the trick, the first one makes sense why it wouldnt work since it says that the color is "undefined" but it isnt a string called "undefined." So I'm not sure how to go about this at all now.
View 3 Replies
View Related
Mar 24, 2013
I have created a path with multiple strokes, which differ in weight and color. I can save that as a profile but it's really tedious if I want to alter the different colors and stroke weights.
I can't seem to do record an action which will automatically alter those parameters (f.ex. raise each strokeweight by 10pt.). All I get is just an action that will recreate the altered state during recording (f.ex. stroke weights 20, 10 >--Action--> 15, 5). I cannot start the action and raise or lower my stroke weights at once based on the current parameters.
View 1 Replies
View Related
Feb 24, 2013
I have a bit of a problem with apple script, I'm creating a Text item and setting the stroke to 0.4pt then i want the stroke miter limit to be set to 2 but it wont work i get :-
Adobe Illustrator got an error: Can’t set properties of text frame 1 of layer 1 of document 1 to {stroke miter limit:2}. (error -10006) but im am able to apply a stroke miter limit of 2 on a path item, is there a way of converting the text frame to a path item then applying the stroke miter limit to it.
on TicketFront_(posX, posY)
tell application "Adobe Illustrator"
activate
set ticketItem to make new text frame in theDoc with properties {contents:{"Some Text"}, position:{(35.7 + posX) * 2.834645, (173.5 - posY) * 2.834645}}
set properties of the text of ticketItem to {text font:text font "Raleway-Thin", size:5.54, justification:center, fill color:{class:spot color info, tint:100.0, spot:spot "PANTONE 4535 U" of document 1}, stroke color:{class:spot color info, tint:100.0, spot:spot "PANTONE 4535 U" of document 1}, horizontal scale:126.46, stroke weight:0.4}
[code]...
ive also tryed putting convert to paths ticketItem in the script which converts the text to paths but the stroke miter limit still dont work.
View 17 Replies
View Related
Sep 12, 2013
Such a scenario:
1 Use the palette apperance can add a new strok to the object.
2 Now, to the stroke, I might add transformations.
3 I want to creatively find the amount of transformations. Turn to preview the changes.
4 Unfortunately, the slider is not precise and varies the size too much.
5 So I make the cursor to the field, and now controls the change of the unit using the keypad.
For example,
Shift + Arrow UP or Down - increments of 10 units
Alt + Arrow UP or Down - jump by one unit
CMD + Arrow UP or Down - jump about half of the
I do work in mm, I would be more precise if I can change the pitch CMD + UP or Down Arrow to jump about 1/10 the unit?
When working with a palette of transformations in view of the above, it is impossible to move the cursor selected object, such as it is in Photoshop when working with a palette of effects? Such a solution would be very fast and very creative.
View 5 Replies
View Related
Nov 14, 2012
I have a file with two squares with red and blue fill colors respectively and transparent surrounding strokes. I'm trying to find a way to automatically set the stroke color of each square to the respective fill color. Is there an Illustrator script somewhere that would achieve that? I am not aware of an internal Illustrator command for this purpose.
View 8 Replies
View Related
Aug 12, 2013
I can create a shape, drop in an image from outside world, put the shape on top of it, [Command + 7] to create a clipping mask now... I want a nice border around the OUTSIDE of the shape.
I can get a centered stroke. But that's not much use as it begins obscuring some of the content as soon as the stroke has any decent amount of width.I can double click "into" the mask object, and change the stroke to "outside" or "inside" via the Stroke panel, but at this point the stroke disappears.
View 12 Replies
View Related
Jul 10, 2013
I have placed a image in illustrator and i tried to put a simple black stroke round it but it doesnt work. what am i doing wrong.
View 3 Replies
View Related
Oct 22, 2012
I just applied the Adobe Illustrator patch for CS6 this morning bringing it up to version 16.0.2. Ever since then, when I apply a stroke to an object,it deforms it. When I update the stroke weight, it deforms it.
This is making the program completely unusable.
View 6 Replies
View Related
Oct 6, 2012
I have created many different objects in Photoshop and placed them exactly where I want them. I do now however need a stroke, and the stroke in photoshop is rounded, and I need a stroke with sharp corners.
Therefor I need to import all of the images together into Illustrator and give them a stroke. The only problem is that when I import the images all of them get created into one object with a white background, and when I apply a stroke, it applies it to the rectangle surrounding all the objects. How can I fix this?
View 10 Replies
View Related
Aug 16, 2011
How to Raster a object in illustrator with scripting?
View 7 Replies
View Related
Jan 27, 2014
Just started working in Illustrator CC. I can't find the control to set stroke color.
View 2 Replies
View Related