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

Looking for a Merge Swatches Workaround

Community Expert ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

I have a scenario in which i need to replace some placeholder colors with production colors (that will be determined at runtime from some data). The placeholder colors exist inside a textFrame with multiple layers of appearance and often time there are gradients involved, so I cannot utilize "Select Same Fill/Stroke".

For many instances, I can simply change the name and color value of the placeholder swatch to match the desired production swatch. However this does not work if i need to change two placeholder swatches to the same production swatch (because i receive an error when trying to use a swatch name that already exists..)

Anyone have any ideas in this regard? All of the colors i'm working with are spot colors.

TOPICS
Scripting

Views

1.6K

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 ,
May 01, 2019 May 01, 2019

Copy link to clipboard

Copied

I actually found a way to select two swatches from a script!!!! WOOOOH!!! my problems are solved!!!

NOT!

even when you have two or more swatches selected in your swatches panel, you still cannot merge the two swatches from an action... WHY ADOBE?! WHY DO YOU TORTURE US THIS WAY?! PLEASE FIX THESE DAMN PROBLEMS!!! IT'S BEEN ALMOST A DECADE AND YOU'VE NEVER RESPONDED TO A SINGLE COMPLAINT AMONG THIS ENTIRE COMMUNITY!

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 ,
May 01, 2019 May 01, 2019

Copy link to clipboard

Copied

There is only one older thread with this topic on action to merge swatches – Adobe Illustrator Feedback

You can vote for that.

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 ,
May 01, 2019 May 01, 2019

Copy link to clipboard

Copied

well i voted. i'll just be over here holding my breath...

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 ,
May 02, 2019 May 02, 2019

Copy link to clipboard

Copied

I've been scratching my head with this, it's been a great challenge. I thought I had something, but no, haven't been able nail it.

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 ,
May 03, 2019 May 03, 2019

Copy link to clipboard

Copied

I personally had like 6 different epiphanies that each convinced me i had finally solved it... and each one was more disappointing than the last.

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
Explorer ,
May 03, 2019 May 03, 2019

Copy link to clipboard

Copied

The only way I found to do this is to recursively loop over all the selected pathItems and check the Fill and Stroke properties, manually replacing A with B.

You can then remove the swatch

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 ,
May 04, 2019 May 04, 2019

Copy link to clipboard

Copied

Yea unfortunately that's the only option I can see... I think I'll throw that function behind my default of changing swatch names and values. If I can get away with just changing switches, that's vastly superior to the recursive loop. Some of the artwork I'm processing is quite complex and contains 10s of thousands of pathItems or more. Plus they were all built by many different people at different times, and I've already come across some wonky stuff like compoundPathItems that have no pathItems inside as far as the script is concerned because the compoundPathItem was created out of only groupItems somehow...

It's all doable, but pretty complex and certainly not very efficient.

And after I just typed all of that I realized I still can't do that because much of the artwork is live text with complex appearances with several different fills and strokes and effects. I don't believe I can access those from the script.

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
Valorous Hero ,
May 04, 2019 May 04, 2019

Copy link to clipboard

Copied

Could there be a work-around to try and circumvent the names of the swatches?

On a Mimaki sublimation printer at one of my jobs, there's an internal conversion table that one can utilize to grab Lab values of colors and ensure they are printed with an explicitly-set corresponding process ink value.

If your devices could also have such a mechanism, it may solve your issue wherein you could keep two different swatches but have the color come out the same as far as the printer is concerned. Likewise, if there's some way to use naming with some 'scheme' such as "SPOT Blue" and "SPOT Blue 1" to set a bunch of sequenced names within the device software so that you can have up to x-many color names which map to the same color values.

Just some thoughts here.

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 ,
May 06, 2019 May 06, 2019

Copy link to clipboard

Copied

This is the exact system we currently use, which is why I need to change the swatch names to match our approved/calibrated swatch library. Each printer we use is calibrated individually and our RIP reads each spot color and processes it for the destination printer. I can see the merits of duplicating the swatches as you pointed out, but our production manager does not take kindly to changes in his own process. Regardless of what was actually required on his end, he would view that as an inconceivable task.

I've settled on changing the names to sequenced versions as you said, and just plopping them into swatch groups so that it's unambiguous for the production artist which ones need to be merged. It will take a few seconds for them to merge manually, but at least this still removes the error potential and the extra time necessary to look back and forth between the sales order and the art file.

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
Explorer ,
May 10, 2019 May 10, 2019

Copy link to clipboard

Copied

I was thinking about this.....

You can not change mesh Gradient or Multiple Stoke colors with the script, but you can via a "Select same Fill Color" command where it selects the items (even in clipping paths etc) and you can click on a swatch to change the color. but from the script you can not select the swatches. You need the user to do the clicking.

The best I could come up with is a "User Guided Process" where the script checks an prompts the user to do the necessary actions....

You could do this.... you need a CEP panel or a non modal script UI panel...

1) Create the new swatches you need

2) Create a rectangle on the page or out of sight (very top left of the canvas) and fill and stroke it with the OLD swatch color (Perhaps also tag it)

3) Use excMenuCommand to select Same Fills

4) Check the selection length .. if its 1 then there are no other items on the page the same fill, If its >1 then prompt the user to change the color manually in the swatches "Please select PMS 380 as the FILL then press OK"

5) Check the temp rectangle is now the right color, if not get the user to repeat

6) as a double check reset the temp rectangle back to the OLD swatch and repeat the Select Same Fill command to ensure its length is 1.

7) Repeat for Strokes

8) Remove the temp rectangles. (Find by tags to get all of them?)

It would be a semi-auto method of changing the colors, less prone to human error. And easy to confirm its been completed correctly by checking the selection length is 1 for every color.

You could also temporally change the swatch name , i.e Instead of changing to "Pantone 380 C" change it to ">>SELECT ME AS FILL<<" so its easier for the user to select the right swatch, then change the name back?

OR is is possible to create a Custom Action to select the correct swatch??

---------------------------------------------------------------------------

EDIT: Actually YES, you can create and load a custom action to select a specific swatch by color, load the action, run it then remove it.

[Illustrator]Create, load and execute action all by JS only · GitHub

This command in the action looks easy enough to select the swatch by Name

/event-2 {

  /useRulersIn1stQuadrant 0

  /internalName (ai_plugin_swatches)

  /localizedName [ 8

   5377617463686573 <<< This is a Hex Encoded String = 'Swatches'

  ]

  /isOpen 1

  /isOn 1

  /hasDialog 0

  /parameterCount 1

  /parameter-1 {

   /key 1937204072

   /showInPalette -1

   /type (ustring)

   /value [ 20

    433d3135204d3d31303020593d3930204b3d3130  <<< This is a Hex Encoded String 'C=15 M=100 Y=90 K=10' which is the swatch name

   ]

  }

}

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
Contributor ,
May 16, 2019 May 16, 2019

Copy link to clipboard

Copied

Please update on this post whenever we get a workaround or anything from Adobe side. I am also waiting for this feature. Why they don't expose some command to JS to merge swatches.

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 ,
May 17, 2019 May 17, 2019

Copy link to clipboard

Copied

I'll definitely update if adobe responds.. but that seems less and less likely by the day. Evidently this functionality was last available in CS5.. That means that Adobe has not yet responded to this issue in over 7 years...

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 ,
May 17, 2019 May 17, 2019

Copy link to clipboard

Copied

So I've been looking at the Adobe sdk, I'm thinking of creating a simple plug in for illustrator to help with scripting, send the plug in simple commands to do stuff that scripting, actions or menu commands can't do.

For example "mergeSwatch:5,6"

You can also get the version number or a list of supported commands and get the user to download the latest version if it's out of date.

Something we can all use. We can make a public guthub project, and call it scriptSupport etc. We can add commands to expand script support or just make stuff faster.

There are demo plugins in the sdk, Does anyone have experience with this stuff?

My only issue is time at the moment, so many projects and stuff so to it would be hard to get started on this.

Glenn Wilton

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
Valorous Hero ,
May 18, 2019 May 18, 2019

Copy link to clipboard

Copied

LATEST

Glenn: check out the thread over here: Setting the bleed in AI via Javascript

If I also had time, I would really make the current year be *this is the year* I really try to do something in C++ SDK, for reals this time -but that thread is one example I would immediately revisit whenever this mythical time appears!

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