Copy link to clipboard
Copied
Hi, Introduce my self, Im rico, from indonesia, I just new in illustrator scripting.. I have a problem, I cannot to arrange the position of color swatches name, because the colors list, I call/get from color swatches in illustrator cs4.. (I get the contents swatches color by name). For Example: These are the swatches color names created manually. Blue, red, gold, silver. Option 1: I'd like to arrange them, and make move it after last word, for each color names.. Option 2: is it possible to combine them become one line sentences (blue red gold silver), but the color keep as it names?
Actually, I cant define the length of text, and then if I arrange the dimension for moving them, the problem will come, text will superimpose the next text, or gap each words will far and differently. I need your pavor to help me.. Thank you
Ou encore...
// JavaScript Document
var X = 20;
var Y = -20;
var dec = 3;
var doc = activeDocument;
var pointText = doc.textFrames.pointText([X,Y]);
for (i= 3; i < 8; i++) {
//alert("i = "+i+doc.swatches[i].name)
var wd = pointText.words.add(doc.swatches[i].name)
wd.fillColor = doc.swatches[i].color ;
}
Cela devrait convenir
de elleere
Copy link to clipboard
Copied
Hi,
Could you please post your code in comment or reply instead of as an image.
Copy link to clipboard
Copied
I have attached the some image brother..
Thanks for tried to help me..
Copy link to clipboard
Copied
Salut!
Tout simplement...
Selon cet exemple:
// JavaScript Document
var tab = ["red", "black", "magenta", "cyan"]
var X = 20;
var Y = -20;
var dec = 3;
var doc = activeDocument;
for (i = 0; i < tab.length; i++) {
var pointText = doc.textFrames.pointText([X,Y]);
pointText.contents = tab[i];
X += pointText.width+dec;
}
De elleere
Copy link to clipboard
Copied
Ou encore...
// JavaScript Document
var X = 20;
var Y = -20;
var dec = 3;
var doc = activeDocument;
var pointText = doc.textFrames.pointText([X,Y]);
for (i= 3; i < 8; i++) {
//alert("i = "+i+doc.swatches[i].name)
var wd = pointText.words.add(doc.swatches[i].name)
wd.fillColor = doc.swatches[i].color ;
}
Cela devrait convenir
de elleere
Copy link to clipboard
Copied
Its work perfectly.. 😄
Thankyou very much Elleere..