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

Applied swatch name...

New Here ,
Aug 13, 2011 Aug 13, 2011

Copy link to clipboard

Copied

Hi,

   I need to remove the unused swatches in a document.  Dont no how to get the swatch name applied in a document with the color value.  Anyone knows pls let me know.

Regards,

Sudha K

TOPICS
Scripting

Views

748

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
Adobe
Community Expert ,
Aug 17, 2011 Aug 17, 2011

Copy link to clipboard

Copied

go to the swatches palette and in the fly out menu, click on the "Select All Unused" menu item, then click on the trash can icon.

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
New Here ,
Aug 22, 2011 Aug 22, 2011

Copy link to clipboard

Copied

Hi,

I need to remove unused swatches using script.  Dont know to find that the document(pageitems in a document) contains the color from swatch group. how to find and remove unused swatches from the swatch palette. If anyone knows let me know.

Thanks,

Sudha K

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
Enthusiast ,
Aug 22, 2011 Aug 22, 2011

Copy link to clipboard

Copied

LATEST

function deleteUnusedSwatches (doc) {      var items = doc.pageItems,      len = items.length,      sw = doc.swatches,      slen = sw.length,      arr = [],      str = null,      i = 0,      j;      for (; i < len; i ++){           doc.selection = [items];           arr.push(sw.getSelected()[0]);      }      str = arr.toString();      for (j = slen - 1; j > 1; j --){           RegExp(sw.name).test(str) || sw.remove();      } } deleteUnusedSwatches(app.activeDocument);

It seems this will do the job.

Edit:

Sorry, this will not work as expected.

And I recall there is already one writed by John Wundes which also remove all unused symbols and etc.

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