Beantwortet
How to check the "Transparency" status
Hi All,
Please help me to find the psd image transparency status, using the indesign javascript. I have attached the image for more information.

Thanks Advance,
Magesh
Hi All,
Please help me to find the psd image transparency status, using the indesign javascript. I have attached the image for more information.

Thanks Advance,
Magesh
Maybe get a list of links, and then check each item in the preflight transparency list to see if it is in the link list:
var doc = app.documents.item(0);
//make a profile if doesn’t exist
try {
var transProfile = app.preflightProfiles.add({name:"CheckTransparency"});
}catch(e) {
var transProfile = app.preflightProfiles.itemByName("CheckTransparency")
}
//set transparency rule
const RULE_NAME = "ADBE_TransparencyUsage";
try {
var myRule = transProfile.preflightProfileRules.add(RULE_NAME);
}catch(e) {
var myRule = transProfile.preflightProfileRules.itemByName(RULE_NAME)
}
myRule.flag = PreflightRuleFlag.returnAsError;
//run the preflight
var myProcess = app.preflightProcesses.add(doc, transProfile);
myProcess.waitForProcess();
var myResults = myProcess.processResults;
//get a list of objects from the results
if (myResults != "None"){
var transList = [];
var errors = myProcess.aggregatedResults;
var errorResults = errors[2];
for (var i = 2; i < errorResults.length; i++){
transList.push(errorResults[i][1])
};
}
myProcess.remove();
//a list of placed links
var docLinks = doc.links
var transLinks = [];
//check if the items in the transparency list are links
for (var i = 0; i < docLinks.length; i++){
if (checkItem(transList, docLinks[i].name)) {
transLinks.push(docLinks[i].name)
}
};
//get the links with transparency list
$.writeln("Links with transparency: " + transLinks)
/**
* Checks if an item is in an array
* the array to check
* the item to look for
* true if the item is in the array
*
*/
function checkItem(a, obj) {
for (var i = 0; i < a.length; i++) {
if (a[i] === obj) {
return true;
}
}
return false;
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.