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

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

Community Beginner ,
Oct 01, 2020 Oct 01, 2020

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.

TOPICS
Scripting
2.4K
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
Community Expert ,
Oct 01, 2020 Oct 01, 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

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
Valorous Hero ,
Oct 02, 2020 Oct 02, 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.

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
Community Beginner ,
Oct 02, 2020 Oct 02, 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.

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
Valorous Hero ,
Oct 02, 2020 Oct 02, 2020

I wonder if the settings in Edit > Assign Profile would have an effect of doing what you need?

Silly-V_0-1601657533908.pngexpand image

 

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
Community Beginner ,
Oct 02, 2020 Oct 02, 2020

Thanks for following up.

 

Yes if we assign a profile in that dialog *manually* we are able to include the profile when scripting the SaveAs function.

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
Community Beginner ,
Oct 02, 2020 Oct 02, 2020

Just to follow up to my last response, the problem we are encountering is that we will not be able to have any manual interaction with the files, so the profile assignment needs to happen programmatically, not based on any user actions.

 

Thanks.

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
Valorous Hero ,
Oct 02, 2020 Oct 02, 2020

Maybe someone really advanced could potentially insert the profile into the file without any interaction, but for your immediate solution you could benefit from AppleScript on Mac or AutoHotKey on Windows to press this button automatically.

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
Community Beginner ,
Oct 02, 2020 Oct 02, 2020

Thanks for the reply.

 

Yes, we've tried going to PDF and back, but without a color profile already assigned to the document, nothing gets included.

 

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
Community Expert ,
Oct 02, 2020 Oct 02, 2020

Hmm, that makes things hard. As a last resort, perhaps you could clone the artwork into a new file based on a template that *does* contain the ICC profile? Via script you would also have to match artboard sizes and other things.

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
Community Expert ,
Oct 03, 2020 Oct 03, 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}" 

 

 

 

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
Community Beginner ,
Oct 15, 2020 Oct 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.

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
Valorous Hero ,
Oct 15, 2020 Oct 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...)

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.

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
Advisor ,
Dec 07, 2022 Dec 07, 2022
LATEST

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

 

 

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