Add icc profiles dynamically with scripting and photoshop configurator?

Post Reply
tkittel
Member
Posts: 50
Joined: Thu Jul 21, 2011 7:30 am

Add icc profiles dynamically with scripting and photoshop configurator?

Post by tkittel »

Hello all,



I'm trying to create a script for the photoshop configurator, which attachs dynamically an icc profile to an incoming tiff file (without icc profile). Unfortunately my scripting knowledge is very poor, so I tried to use the script just to call different photoshop actions (which defines the icc profile to tag). The photoshop actions are placed in an set named "PowerSwitch". The dynamic variable should be the '[Job.JobState]' as $arg1 and contains the '[Stats.ICCProfile]', which was read before (at the start of file conversion from eps to tiff).



To simplify all this, I'll reduce to a 4-step flow:

1. 'in' folder

2. 'read' folder (which sets the '[Job.JobState]' to [Stats.ICCProfile]

3. photoshop configurator named 'save_eps_as_tiff' ('open' automatically, 'command' use script 'add_icc_profile.sscript', 'parameter1' = [Job.JobState], 'save as' TIFF, no compression, embedd icc profile YES)

4. 'out' folder



At the moment my 'add_icc_profile.sscript' looks like that, but it doesn't run (error message: 'function not available in photoshop' and "syntax error in line 90'):



function jobArrived( s : Switch, job : Job )

{

app.doAction ($arg1,"PowerSwitch");

}



Instead of using the script only to start the different photoshop actions, it should be more effective to tag the icc profile directly in the script. Perhaps there is a way, to

1. open incoming files (in my case tiff only) with photoshop

2. directly use scripting to tag an icc profile, who's name is defined by the [Job.JobState] (which is similar to the [Stats.ICCProfile] of the original file format read before)

3. save it as 'tiff' with embedded icc profile, without compression into the only outgoing connection



How to realize that?



Thanks in advance,

Thomas
dkelly
TOP CONTRIBUTOR
Posts: 628
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Add icc profiles dynamically with scripting and photoshop configurator?

Post by dkelly »

[Stats.ICCProfile] would indicate the incoming TIFF file already had an embedded ICC profile.



Your script won't work in Photoshop. That's a Switch script, not for Photoshop.



Photoshop can't assign a profile from a file using Javascript. It has to be installed in OS already.
tkittel
Member
Posts: 50
Joined: Thu Jul 21, 2011 7:30 am

Add icc profiles dynamically with scripting and photoshop configurator?

Post by tkittel »

Hello Dwight and thank you for your statements:

[Stats.ICCProfile] would indicate the incoming TIFF file already had an embedded ICC profile.
That's right, but you missunderstood this point, because I simplified my challenge a little bit too much ;o)

The incoming files are eps files with icc profiles, so at the beginnig of the flow the original icc profile name of each .eps should be read and saved as jobestate. After distilling the eps files into pdf and export the pdfs as tiffs via Acrobat (in their original resolutions), the tiffs should be opened with photoshop and the original icc profile (of the incoming eps at the beginning of the flow) should be tagged (again).



Photoshop can't assign a profile from a file using Javascript. It has to be installed in OS already.
Of course all icc profiles have to be already installed in OSX! But is tagging the icc profile to the tiff then possible with javascript only, or have I although to create lots of photoshop actions, one for each different icc profile?



Your script won't work in Photoshop. That's a Switch script, not for Photoshop.
I thought that I've to use a switch script package to forward the value of the variabel $arg1 (=[Job.JobState] = the original icc profile name of the original eps file) into the photoshop configurator. How to forward this value into a 'normal' (photoshop) javascript, without defining $arg1 ?

Could you pls. give me a small example code to solve this challenge?



Thanks, Thomas
dkelly
TOP CONTRIBUTOR
Posts: 628
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Add icc profiles dynamically with scripting and photoshop configurator?

Post by dkelly »

Switch only extracts Stats.ICCProfile information from JPEG, TIFF and PNG. Not EPSF.
tkittel
Member
Posts: 50
Joined: Thu Jul 21, 2011 7:30 am

Add icc profiles dynamically with scripting and photoshop configurator?

Post by tkittel »

Sorry Dwight,



you're right! In my posts above I accidently wrote [Stats.ICCProfile], but I always meant [Image.ICCProfile] instead. That's the way I detect the icc profiles of the incoming eps files.



So it should be possible somehow, to tag them later again to the resulting tiffs, or am I false?
dkelly
TOP CONTRIBUTOR
Posts: 628
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Add icc profiles dynamically with scripting and photoshop configurator?

Post by dkelly »

I wrote a configurator to set any tag in a TIFF file. This flow uses Apago's PSServices to convert EPS to TIFF (more reliable than Acrobat) and the tiffset to add the profile from the original EPS to the ripped TIFF.







Here's the parameters for tiffset. The ICC profile is stored in TIFF tag #34675.







Dwight Kelly

Apago, Inc.

dkelly@apago.com
tkittel
Member
Posts: 50
Joined: Thu Jul 21, 2011 7:30 am

Add icc profiles dynamically with scripting and photoshop configurator?

Post by tkittel »

Hello Dwight,



thank you for this information. I'll discuss this with my boss, when he'll return from holiday.



Have a nice day!

Thomas
Post Reply