Highlighted

How to arrange the position of texts that get by by name of swatches name in illustrator script

New Here ,
Jul 29, 2020

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

 

TOPICS
Scripting

Views

103

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to arrange the position of texts that get by by name of swatches name in illustrator script

New Here ,
Jul 29, 2020

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

 

TOPICS
Scripting

Views

104

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 29, 2020 0
Adobe Community Professional ,
Jul 29, 2020

Copy link to clipboard

Copied

Hi,

Could you please post your code in comment or reply instead of as an image.

Best regards

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
New Here ,
Jul 30, 2020

Copy link to clipboard

Copied

I have attached the some image brother..

 

Thanks for tried to help me..

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 30, 2020 0
Enthusiast ,
Jul 29, 2020

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

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
Enthusiast ,
Jul 29, 2020

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

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
ricoc7 LATEST
New Here ,
Jul 30, 2020

Copy link to clipboard

Copied

Its work perfectly.. 😄

Thankyou very much Elleere..

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 30, 2020 0