Reply To: Color Profile Text Variable

#99104
Anonymous
Inactive

//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();

This article was last modified on October 19, 2017

Comments (0)

Loading comments...