Creating A Preset Using New Values - Adobe 27510753 - InDesign CS2 - PC Manual

Scripting guide
Hide thumbs Also See for 27510753 - InDesign CS2 - PC:
Table of Contents

Advertisement

86
Working with Documents in AppleScript
--DocumentPresetByExample.as
--An InDesign CS2 AppleScript
--Creates a new document preset based on the current document settings.
tell application "Adobe InDesign CS2"
if (count documents) > 0 then
set myDocument to active document
--If the document preset "myDocumentPreset" does not already exist, create it.
try
set myDocumentPreset to document preset "myDocumentPreset"
on error
set myDocumentPreset to make document preset with
end try
--Fill in the properties of the document preset with the corresponding
--properties of the active document.
tell myDocumentPreset
--Note that the following gets the page margins from the margin preferences
--of the document; to get the margin preferences from the active page,
--replace "myDocument" with "active page of active window" in the
--following line (assuming the active window is a layout window).
set myMarginPreferences to margin preferences of myDocument
set left to left of myMarginPreferences
set right to right of myMarginPreferences
set top to top of myMarginPreferences
set bottom to bottom of myMarginPreferences
set column count to column count of myMarginPreferences
set column gutter to column gutter of myMarginPreferences
set document bleed bottom offset to document bleed bottom offset
set document bleed top offset to document bleed top offset
set document bleed inside or left offset to document bleed inside
set document bleed outside or right offset to document bleed outside
set facing pages to facing pages of document preferences of myDocument
set page height to page height of document preferences of myDocument
set page width to page width of document preferences of myDocument
set page orientation to page orientation of document preferences
set pages per document to pages per document of document preferences ¬
set slug bottom offset to slug bottom offset of document preferences
set slug top offset to slug top offset of document preferences of myDocument
set slug inside or left offset to slug inside or left offset
set slug right or outside offset to slug right or outside offset
end tell
end if
end tell

Creating a preset using new values

To create a document preset using explicit values, run the following script:
--DocumentPreset.as
--An InDesign CS2 AppleScript
--Creates a new document preset.
tell application "Adobe InDesign CS2"
--If the document preset "myDocumentPreset" does not already exist, create it.
try
set myDocumentPreset to document preset "myDocumentPreset"
on error
set myDocumentPreset to make document preset
properties {name:"myDocumentPreset"}
of document preferences of myDocument
of document preferences of myDocument
or left offset of document preferences of myDocument
or right offset of document preferences of myDocument
of myDocument
of myDocument
of myDocument
of document preferences of myDocument
of document preferences of myDocument
Adobe InDesign CS2 Scripting Guide
¬
¬
¬
¬
¬
¬
¬
¬
¬
¬

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents