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

Select and Merge Swatches via javascript

Contributor ,
Jul 03, 2016 Jul 03, 2016

Is there a way to: 1. Select swatches in swatch panel with JS 2. Use the Merge Swatches command with JS

TOPICS
Scripting
1.1K
Translate
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
Guide ,
Jul 03, 2016 Jul 03, 2016

You can select using itemByName from swatch and for merge swatches the velow links are useful

merge selected swatches...

Re: Merging swatches

Translate
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
Contributor ,
Jul 04, 2016 Jul 04, 2016

There is no method itemByName in javascript , but there is a method getByName. This will return a swatch but does not select  in swatch panel.

Translate
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
Guide ,
Jul 04, 2016 Jul 04, 2016

You are right..Sorry..am new in Illustrator scripting.. in Indesign we used itemByName..

Translate
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
Explorer ,
Jul 11, 2016 Jul 11, 2016

Try app.activeDocument.layers.getByName ("layer name").selected=true;

Translate
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
Contributor ,
Jul 11, 2016 Jul 11, 2016

The code you write is for layers. Although it will not worked for layers as well but my requirement is to select the swatch from swatch panel of the Illustrator.

Translate
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
Explorer ,
Mar 29, 2023 Mar 29, 2023
LATEST

Hey Developer1009,

have you found a solution for merging the swatches? I'm looking for the same feature, but I cannot find any solution.

regards!

Translate
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