Highlighted

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

Community Beginner ,
Oct 01, 2020

Copy link to clipboard

Copied

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
How to, Scripting

Views

159

Likes

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

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

Community Beginner ,
Oct 01, 2020

Copy link to clipboard

Copied

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
How to, Scripting

Views

160

Likes

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
Oct 01, 2020 0
Contributor ,
Oct 01, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Oct 01, 2020 1
Adobe Community Professional ,
Oct 02, 2020

Copy link to clipboard

Copied

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.

Likes

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

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Oct 02, 2020 1
Adobe Community Professional ,
Oct 02, 2020

Copy link to clipboard

Copied

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

Silly-V_0-1601657533908.png

 

Likes

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

Copy link to clipboard

Copied

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.

Likes

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

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Oct 02, 2020 1
Adobe Community Professional ,
Oct 02, 2020

Copy link to clipboard

Copied

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.

Likes

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

Copy link to clipboard

Copied

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.

 

Likes

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
Reply
Loading...
Oct 02, 2020 0
Contributor ,
Oct 02, 2020

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Oct 02, 2020 0
Adobe Community Professional ,
Oct 03, 2020

Copy link to clipboard

Copied

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}" 

 

 

 

Likes

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
Reply
Loading...
Oct 03, 2020 1
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Oct 15, 2020 0
Silly-V LATEST
Adobe Community Professional ,
Oct 15, 2020

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Oct 15, 2020 0