Skip to main content
Participating Frequently
October 1, 2020
Question

Is it possible to assign and embed a color profile with an Action or script and no user interaction?

  • October 1, 2020
  • 3 replies
  • 3003 views

Hello.

 

We need to be able to assign and embed the color profile associated with the current Color Settings for a given file and ensure it is included when (re)saving in AI format. This needs to happen hands off in a high-volume environment.

 

We have tried many different approaches to creating Actions that would do this, as well as exploring scripting this functionality.

 

However nothing we have been able to come up with actually assigns and/or embeds the color profile.

 

I'm hoping some of the scripting gurus on this list can advise if this kind of functionality is even possible within Illustrator using scripting or scripted Actions. Thanks in advance for any pointers or guidance you mnight be able to provide.

This topic has been closed for replies.

3 replies

schroef
Inspiring
December 8, 2022

Have you found a solution or are you using jg the VBS implementation?

 

I'm in search for sure mething likewise, though i need the script to be able to run on multiple OS's. On osx i can run os commands, did so in photoshop scripts already. My workaround for windows was also using VBS to stimulate a key press.

 

Issue is, i need to create a new document and have the new document have the same profile as the open one. We can use app.colorprofile, something like that, but that is only the general setting. If an open document is different from that, this trick won't work.

 

So why guess i need to test the VBS approach. Now i need to figure out how to send a color profile name to the VBS so it can call that in the assignPeofile menu command

 

 

CarlosCanto
Community Expert
Community Expert
October 4, 2020

going by the suggestions above, here's a vbs that simulates a user assigning a profile. The script can be installed and be included in an action.

 

it goes without saying, this is windows only. Also, sendkeys command is mighty unpopular, it could wreck chaos very easily...but it works if supervised

 

 

 

Set objShell = CreateObject("WScript.Shell")

objShell.sendkeys "%ea"

objShell.SendKeys "%w" 

objShell.SendKeys "{Enter}" 

 

 

 

Participating Frequently
October 15, 2020

Hi Carlos

 

Apologies for the delayed reply, but I've just been able to return to this part of our larger implementation. Thank you for your reply.

 

Your VB script works flawlessly everytime when placed in the Scripts folder and attached to an Action that is manually invoked within the program. Thank you for that.

 

However when we try to call that Action from outside Illustrator, the Action does not invoke correctly and does not choose the Working Space option in the Assign Profile... dialog. It also doesn't work if we try using it within a JSX script that executes the .vbs script separately using execute().

 

Is there possibly some security setting somewhere that needs changing to allow the VB script to run properly when called via a .jsx script using app.doScript() or execute()?

 

Thansk again.

Silly-V
Legend
October 15, 2020

See if you are experiencing a script-action interoperability issue as determined in this thread: (https://community.adobe.com/t5/illustrator/running-action-with-script-not-working/td-p/11488634?page=1)

The summary is that you can only play actions via scripts and scripts via actions but in a specific arrangement or it won't work.

m1b
Community Expert
Community Expert
October 1, 2020

I've never done this, but I wondered if you could save documents as pdf first (with PDFSaveOptions.preserveEditability set), using the PDFSaveOptions.colorProfileID property or the PDFSaveOptions.destinationID property and then re-saving as Illustrator document with IllustratorSaveOptions.embedICCProfile set to true.

 

Far fetched I know and you may have tried already.

 

Mark

Silly-V
Legend
October 2, 2020

It would make sense that embedICCProfile would do the job, even without the other things.

But I've never done this, so I'd be interested to know whether it works and satisfies this question.

Participating Frequently
October 2, 2020

Thanks for the response. If there is a profile assigned to the file, embedICCProfile does work. Our issue is that none of the incoming files has any profile attached and changing the document's color settings with a script doesn't explicitly assign a color profile. That's the missing mechanism we cannot find out how to do, either with an Action or in a script.