Adobe 0046100128056 Scripting Guide - Page 141
Listing preflight rules, Listing preflight data objects
UPC - 718659087562
View all Adobe 0046100128056 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 141 highlights
CHAPTER 10: Working with Preflight Exploring Preflight Profiles 141 Listing preflight rules This script fragment shows how to list all preflight rules in a profile. For the complete script, see ListPreflightRules. // Assume the [Basic] profile exists var myProfile = app.preflightProfiles.item(0); var myRules = myProfile.preflightProfileRules; var ruleCount = myRules.length; var str = "Preflight rules of " + myProfile.name + ": "; for (var i = 0; i < ruleCount; i++) { if (i > 0) { str += ", "; } str += myRules.item(i).name; } alert(str); Listing preflight data objects This script fragment shows how to list all preflight data objects in a profile rule. For the complete script, see ListPreflightDataObjects. // Assume the [Basic] profile exists. var myProfile = app.preflightProfiles.item(0); // rule ADBE_BlankPages var myRule = myProfile.preflightProfileRules.item(0); var dataObjects = myRule.ruleDataObjects; var dataObjectCount = dataObjects.length; var str = "Preflight rule data objects of " + myProfile.name + "." + myRule.name + ": "; for (var i = 0; i < dataObjectCount; i++) { if (i > 0) { str += "; "; } str += dataObjects.item(i).name + ", "; str += getDataObjectDataType(dataObjects.item(i).dataType) + ", "; str += dataObjects.item(i).dataValue; } alert(str); function getDataObjectDataType(type) { if (type == RuleDataType.BOOLEAN_DATA_TYPE) { return "Boolean"; } else if (type == RuleDataType.INTEGER_DATA_TYPE) { return "Integer"; } else if (type == RuleDataType.LIST_DATA_TYPE) { return "List"; }