Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Can anyone help with changing colors without making a selection

$
0
0

I've been trying to work the the script below. All the front most paths are black I want to change them all to yellow without having to select them first.

 

Any help would be really appreciated. "I am a novice javascripter"

 

var myStyles = app.activeDocument.pathItems;

lastStyle=myStyles[myStyles.length-1]

lastStyle.remove();

frontStyle=myStyles[0]

frontStyle.filled=true;

 

 

 

// Sets the default fill color in the current document to yellow.

if ( app.documents.length > 0 ) {

//added

 

frontPath = frontStyle;

 

// Define the new color

var newRGBColor = new RGBColor();

newRGBColor.red = 255;

newRGBColor.green = 255;

newRGBColor.blue = 0;

// Use the color object in the path item

frontPath.filled = true;

frontPath.fillColor = newRGBColor;

}


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>