I have created a script where upon opening a Photoshop scene, an icc profile will be copied to "C:\Program Files (x86)\Common Files\Adobe\Color\Profiles". This icc profile will then be applied through a snipped of code obtained from the Script Listener plugin. This snippet was acquired through running "View>Proof Setup>Custom...". My script will fail at the point where the profile is being applied, however it seems to work if the custom profile dialog is opened, closed and the script is run again. It seems like Photoshop needs to initialise newly copied icc profiles and this is happening when the dialog is opened, but I'm not entirely sure.
This is being run on Windows 7, Photoshop CS6 v13.0
Whilst running Photoshop, copy an icc profile into "C:\Program Files (x86)\Common Files\Adobe\Color\Profiles".
Use the function below, passing the copied profile name through it. This should fail.
Open "View>Proof Setup>Custom..." and close.
re-run the function.
var idproofSetup = stringIDToTypeID( "proofSetup" );
var desc36 = new ActionDescriptor();
var idprofile = stringIDToTypeID( "profile" );
desc36.putString( idprofile, profile_name );
var idpreserve = stringIDToTypeID( "preserve" );
desc36.putBoolean( idpreserve, true );
executeAction( idproofSetup, desc36, DialogModes.NO );
If anyone has any insight into this, it would be greatly appreciated.