EasyManua.ls Logo

Adobe 0046100128056 - InDesign - Mac - Listing Preflight Rules; Listing Preflight Data Objects

Adobe 0046100128056 - InDesign - Mac
209 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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";
}

Table of Contents

Related product manuals