Creating A Document Template - Adobe 27510753 - InDesign CS2 - PC Manual

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

Advertisement

92
Working with Documents in AppleScript
You can also add XMP information to a document using InDesign scripting. All XMP properties for a document
are in the document's metadataPreferences object. Here's an example that fills in the standard XMP data
for a document.
This example also shows that XMP information is extensible. If you need to attach metadata to a document
and the data does not fall into one of the categories provided by the metadata preferences object, you can
create your own metadata container ( email , in this example).
--MetadataExample.as
--An InDesign CS2 AppleScript
--Creates an example document and adds metadata to it.
tell application "Adobe InDesign CS2"
set myDocument to make document
tell metadata preferences of myDocument
set author to "Olav Martin Kvern"
set copyright info URL to "http://www.adobe.com"
set copyright notice to "This document is copyrighted."
set copyright status to yes
set description to "Example of xmp metadata scripting in InDesign CS"
set document title to "XMP Example"
set job name to "XMP_Example_2004"
set keywords to {"animal", "mineral", "vegetable"}
--The metadata preferences object also includes the read-only
--creator, format, creationDate, modificationDate, and serverURL properties that
--are automatically entered and maintained by InDesign.
--Create a custom XMP container, "email"
set myNewContainer to create container item
set property namespace "http://ns.adobe.com/xap/1.0/"
end tell
end tell

Creating a document template

This example creates a new document, defines slug and bleed areas, adds information to the document's XMP
metadata, sets up master pages, adds page footers, and adds job information to a table in the slug area:
--DocumentTemplate.as
--An InDesign CS2 AppleScript
--Creates a document template, including master pages, layers, a color, paragraph and character
styles, guides, and XMP information.
tell application "Adobe InDesign CS2"
--Make a new document.
set myDocument to make document
tell myDocument
tell document preferences
set page width to "7i"
set page height to "9i"
set page orientation to portrait
end tell
tell margin preferences
set top to ((14 * 4) & "pt") as string
set left to ((14 * 4) & "pt") as string
set bottom to "74pt"
set right to ((14 * 5) & "pt") as string
end tell
--Set up the bleed and slug areas.
tell document preferences
--Bleed
set document bleed bottom offset to "3p"
set document bleed top offset to "3p"
set document bleed inside or left offset to "3p"
set document bleed outside or right offset to "3p"
namespace "http://ns.adobe.com/xap/1.0/" path "email"
path "email/*[1]" value "okvern@adobe.com"
Adobe InDesign CS2 Scripting Guide
¬
¬

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents