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

Write used color swatch names as text on the artboard

Explorer ,
Jan 31, 2011 Jan 31, 2011

Copy link to clipboard

Copied

Anyone know if it is possible to write a script that will take all of your "used swatches" and write a list of their swatch names on the artboard?  Would be very useful for art approval documents.

TOPICS
Scripting

Views

7.3K

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

Guide , Mar 30, 2011 Mar 30, 2011

#target illustrator function swatchNamesToText() {      if (app.documents.length = 0) {           return;      } else {           var docRef = app.activeDocument;                      var sel = docRef.selection;                                if (sel.length == 1 && sel[0].typename == 'TextFrame') {                           var nameList = Array();                           var swatGrps = docRef.swatchGroups;                                     for (var i = 0; i < swatGrps.length; i++) {    

...

Votes

Translate

Translate
Adobe
Community Expert ,
Dec 05, 2017 Dec 05, 2017

Copy link to clipboard

Copied

doesn't saving it as .jsx negate that issue, Larry? I admit i've never tried, but i didn't think you could save a rich text file into jsx format.

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 ,
Dec 05, 2017 Dec 05, 2017

Copy link to clipboard

Copied

When I was converting from rich text, it would throw an error message when I tried to run the script. After converting it from rich text to plain text it doesn't throw the error message anymore but nothing happens at all ... Hmmm.. Has anyone else successfully used the code from above?

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 Expert ,
Dec 05, 2017 Dec 05, 2017

Copy link to clipboard

Copied

it appears that script is a fairly customized script that requires some conditions to be present in the file upon executing the script. however there is no handling or alerts when conditions aren't met.

You likely need something similar to this, but not exactly. So you'll either need to re-work it or try to find someone to re-work it for you. It would be best to create a new post for that though rather than continue to piggyback on this older thread.

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