Color Profile Text Variable

Viewing 1 reply thread
  • Author
    Posts
    • #99082

      I would like to modify this script to pull in the Assigned Color Profile of the document instead of the Page Size. Can anyone help me with that?

      ar doc = app.activeDocument;
      doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;
      doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;
      for(var i =0;i<doc.pages.length;i++)
      {
      pagesize = app.activeDocument.textVariables.itemByName(“PageSize”);
      pagesize.variableOptions.contents = doc.pages[i].bounds[3] + “w x ” + doc.pages[i].bounds[2] + “h”
      }

    • #99104
      Loic Aigon
      Member

      //Main routine
      //helps adding the CMYK & RBG profiles variables
      var main = function() {
      var doc = app.properties.activeDocument,
      cmyk, rgb;

      if ( !doc ) return;

      //Creating CMYK profile variable
      setVariable (doc, “CMYK profile”, doc.cmykProfile);

      //Creating RGB profile variable
      setVariable (doc, “RGB profile”, doc.rgbProfile);

      }

      //generic function for adding a text variable
      var setVariable = function(doc, varName, varContent ) {
      var v = doc.textVariables.itemByName ( varName );
      if ( !v.isValid ) {
      v = doc.textVariables.add({name:varName});
      }
      v.variableOptions.contents = varContent;
      }

      //Let’s go
      main();

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
>