Having trouble with .icc Profile not reading.

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

zachm

Having trouble with .icc Profile not reading.

Post by zachm »

Hey all, I have a situation here where I am using a .bat to take the name of a file, break it apart, and copy a .icc profile from a spot on the network onto my local machine. The only problem is that PS doesn't see the .icc after it's been copied over. It DOES however work if I do it manually and then run the script again, then PS sees the .icc profile and assigns it.

What I'm hoping is that there's a command to refresh the list in view=>proofSetup=>Custom=Device to simulate:

I wrote a line in to test it:

Code: Select allfunction proof_generic(){
    var idproofSetup = stringIDToTypeID( "proofSetup" );
    var desc2057 = new ActionDescriptor();
    var idprofile = stringIDToTypeID( "profile" );
    desc2057.putString( idprofile, """Apple RGB""" );
    var idpreserve = stringIDToTypeID( "preserve" );
    desc2057.putBoolean( idpreserve, true );
    executeAction( idproofSetup, desc2057, DialogModes.NO );
    }

proof_generic();

So in this bit of code I"m just applying the default Apple RGB .icc on there and if I call that function, it works, but the minute I copy in another .icc off the network, then the script just plain won't read it, however if I go in manually it's there and I can see it and assign it. After doing that, the script works just fine, but that defeats the purpose.

Also here's the code I have for the .bat file:

Code: Select all        var bat = new File(Folder.temp + "/iccYou.bat")
         bat.open("w");
       
         bat.writeln("robocopy" + " " + copyPath1 +  getName + copyPath2 + " " + cPath + " " + iccName + ".icc");
         bat.close();
         bat.execute();


Totally confused on how to handle this, Just hoping that there's a force list read command that I'm missing or something. Thanks ahead!
poopsmcgee

Having trouble with .icc Profile not reading.

Post by poopsmcgee »

You can't have the icc profile on the machine before running the script?

Have you attempted to separate out the functions of your script such that one part does the copying and then another part calls the same functions? It seems like that might be a backwards way of getting the view to be refreshed before the related code is run... i.e. having one script call the other
zachm

Having trouble with .icc Profile not reading.

Post by zachm »

poopsmcgee wrote:You can't have the icc profile on the machine before running the script?

Have you attempted to separate out the functions of your script such that one part does the copying and then another part calls the same functions? It seems like that might be a backwards way of getting the view to be refreshed before the related code is run... i.e. having one script call the other

No, Because what I'm dealing with requires me to have literally hundreds of icc profiles available in order. It needs to be more dynamic, as it will be servicing multiple people with different needs for different profiles. If I have the hundreds of icc profiles in the list, it slows everything down to a halt.

To answer your second question, again no, and that's what I am doing. I've come to the conclusion at this point that it's just either a limitation or a bug. Manually refreshing the menu, or creating a new document works, but if you do any of the things that work by manually clicking on the menu to get to it by using a script, the new icc remains invisible.