Applying the document profile script does not work

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

MIRYAMM

Applying the document profile script does not work

Post by MIRYAMM »

I work with laboratory profiles, and ocassionally some photo go with a wrong profile, and, that's when I realized,that my script don't work well

how to make a script to convert a profile to an image that already has the profile

Here is the code so that I can help, please

Code: Select allvar idconvertToProfile = stringIDToTypeID( "convertToProfile" );
    var desc442 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref52 = new ActionReference();
        var idDcmn = charIDToTypeID( "Dcmn" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref52.putEnumerated( idDcmn, idOrdn, idTrgt );
    desc442.putReference( idnull, ref52 );
    var idT = charIDToTypeID( "T   " );
    desc442.putString( idT, "Adobe RGB (1998)" );
    var idInte = charIDToTypeID( "Inte" );
    var idInte = charIDToTypeID( "Inte" );
    var idImg = charIDToTypeID( "Img " );
    desc442.putEnumerated( idInte, idInte, idImg );
    var idMpBl = charIDToTypeID( "MpBl" );
    desc442.putBoolean( idMpBl, true );
    var idDthr = charIDToTypeID( "Dthr" );
    desc442.putBoolean( idDthr, true );
    var idsdwM = charIDToTypeID( "sdwM" );
    desc442.putInteger( idsdwM, 2 );
executeAction( idconvertToProfile, desc442, DialogModes.NO );

Thanks to all

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Applying the document profile script does not work

Post by Mike Hale »

If you want to make sure the document is in has the Adobe RGB profile one way to do this would be to first check it's current profile to see if it needs to be changed. Then convert only when needed.
Code: Select allif(app.activeDocument.colorProfileName != "Adobe RGB (1998)"){
   app.activeDocument.convertProfile( "Adobe RGB (1998)", Intent.PERCEPTUAL,true,true);
}
MIRYAMM

Applying the document profile script does not work

Post by MIRYAMM »

Thanks a millon, Mike.
Is just I need