• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
Jul 29, 2020 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

TOPICS
Scripting

Views

366

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
community guidelines

correct answers 1 Correct answer

Advocate , Jul 29, 2020 Jul 29, 2020

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

 

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 29, 2020 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

Votes

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
community guidelines
Community Beginner ,
Jul 30, 2020 Jul 30, 2020

Copy link to clipboard

Copied

I have attached the some image brother..

 

Thanks for tried to help me..

Votes

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
community guidelines
Advocate ,
Jul 29, 2020 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

 

Votes

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
community guidelines
Advocate ,
Jul 29, 2020 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

 

Votes

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
community guidelines
Community Beginner ,
Jul 30, 2020 Jul 30, 2020

Copy link to clipboard

Copied

LATEST

Its work perfectly.. 😄

Thankyou very much Elleere..

Votes

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
community guidelines