2 Replies Latest reply on Feb 4, 2018 6:23 PM by Kukurykus

    distinguishing between document colour modes and document type in a script

    spaciousmind Level 1

      Hi, I have a bunch of (javascript) batch export scripts that I use on a daily basis in photoshop..... but there's something I still haven't figured out how to do which would be very helpful to know. This stuff is probably really basic I just haven't been able to figure it out yet:


      I want to be able to know in a script what the current document colour mode is.
      so for example, if it's RGB then I can do something like this this:

       

      app.activeDocument.convertProfile("Working CMYK", Intent.RELATIVECOLORIMETRIC, true, true ); 

      activeDocument.resizeImage( null, null, 300, ResampleMethod.NONE );

      saveCMYK_flat_PSD();

      activeDocument.close(SaveOptions.DONOTSAVECHANGES)

       

      otherwise if it's already CMYK I can just do this:

      activeDocument.resizeImage( null, null, 300, ResampleMethod.NONE );

      saveCMYK_flat_PSD();

      activeDocument.close(SaveOptions.DONOTSAVECHANGES)


      I'd only really need it to tell between CMYK 8-bit , CMYK 16-bit, RGB & Monochrome

      Also it would be really handy to be able to find out in a script what the active document type is, so if it's a .psd for example then I could save the document and close, if it's a jpg I could just close it without saving etc.

       

      Many Thanks!