Adding Rules. Adobe CS5 InDesign
Publicité
Publicité
C
HAPTER
10: Working with Preflight
Adding Rules 154 on removeProfile(profileName) tell application "Adobe InDesign CS5" set myProfiles to preflight profiles set profileCount to count of myProfiles repeat with i from 1 to profileCount if name of item i of myProfiles is equal to profileName then delete item i of myProfiles end if end repeat end tell end removeProfile
Adding Rules
A preflight profile contains a mutually exclusive set of rules. To add a rule to a profile, follow these steps:
1.
Add a rule to a profile by name.
Rules are added by name. For information on rule names, see
. The following adds the ADBE_PageSizeOrientation rule to the profile.
--Add a rule that requires a specific page size and orientation
--(portrait or landscape).
set RULE_NAME to "ADBE_PageSizeOrientation" set myRule to make preflight profile rule in myProfile with properties
{name:RULE_NAME, id:RULE_NAME}
2.
Set the rule’s data values.
Many, but not all, rules have data properties. For a complete specification of the rules available with
InDesign, see “Available Rules” on page 156
. The ADBE_PageSizeOrientation rule contains particular data properties that allow you to specify a page size. The following sets the acceptable page height and width, a tolerance (fudge factor), and an option for handling page orientation.
tell myRule
--Requires the page size to be 8.5in x 11in (Letter Size)
--enters a value for tolerance make rule data object with properties {name:"tolerance", data type:real data type, data value:0.01}
--Sets the width to the point equivalent of 8.5 inches make rule data object with properties {name:"width", data type:real data type, data value:612}
--Sets the width to the point equivalent of 11 inches make rule data object with properties {name:"height", data type:real data type, data value:792}
--true = ignore orientation is checked make rule data object with properties {name:"ignore_orientation", data type:boolean data type, data value:true} end tell
3.
Set the rule’s reporting state.
This is done using the rule’s flag
property. There are several choices (disabled, information, warning, and error), controlled by the
PreflightRuleFlag
enumeration.
Télécharger
Publicité