• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Color profile - conditions

New Here ,
Oct 17, 2015 Oct 17, 2015

Copy link to clipboard

Copied

I have a task to solve and I don't know how to write a condition. Maybe you can help : "Create a script that detects if the image uses a color profile. If used, the script should report the name. If not used, it must inform the user that does not use color profile".

TOPICS
Actions and scripting

Views

493

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
community guidelines
Adobe
Advisor ,
Oct 18, 2015 Oct 18, 2015

Copy link to clipboard

Copied

Try this:

if (app.activeDocument.colorProfileType == ColorProfileType.NONE) {

  alert("This image does not have a Color Profile");

} else {

  alert("The Color Profile of this image is: " + doc.colorProfileName);

}

Votes

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
community guidelines
Engaged ,
Oct 18, 2015 Oct 18, 2015

Copy link to clipboard

Copied

LATEST

Hi Polkomatik,

Try this...

    CHK_Profile();   

    function CHK_Profile(){

        var doc = app.activeDocument;

        var myDocname=doc.name

        try {

            var ecp=doc.colorProfileName;  

            alert("The Color Profile is - " + doc.colorProfileName);

           }

        catch (er) {

            alert("The Image has untagged color profile.. !!!\n\n");

            }     

       }

Votes

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
community guidelines