Exporting Pages As Eps - Adobe 27510753 - InDesign CS2 - PC Manual

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

Advertisement

Adobe InDesign CS2 Scripting Guide
set myFolder to «class ktxt» of (myFolder as record)
if myFolder is not equal to "" then
my myExportPages(myFolder)
end if
end myChooseFolder
on myExportPages(myFolder)
tell application "Adobe InDesign CS2"
set myDocument to active document
set myDocumentName to name of myDocument
set myDialog to make dialog with properties {name:"File Naming Options"}
tell myDialog
tell (make dialog column)
end tell
end tell
set myResult to show myDialog
if myResult is true then
--The name of the exported files will be the base name + the value
--of the counter + ".pdf".
set myBaseName to edit contents of myBaseNameField
--Remove the dialog box from memory.
destroy myDialog
repeat with myCounter from 1 to (count pages in myDocument)
end repeat
else
destroy myDialog
end if
end tell
end myExportPages
on myReplace(myString, myFindString, myChangeString)
set AppleScript's text item delimiters to myFindString
set myTextList to every text item of (myString as text)
set AppleScript's text item delimiters to myChangeString
set myString to myTextList as string
set AppleScript's text item delimiters to ""
return myString
end myReplace

Exporting pages as EPS

When you export a document as EPS, InDesign saves each page of the file as a separate EPS graphic (an EPS,
by definition, can contain only a single page). If you're exporting more than a single page, InDesign appends
the index of the page to the file name. The index of the page in the document is not necessarily the name of
the page (as defined by the section options for the section containing the page).
tell (make dialog row)
make static text with properties {static label:"Base name:"}
set myBaseNameField to make text editbox
with properties {edit contents:myDocumentName, min width:160}
end tell
set myPageName to name of page myCounter of myDocument
set page range of PDF export preferences to name of page myCounter
of myDocument
--Generate a file path from the folder name, the base document name,
--and the page name.
--Replace any colons in the page name (e.g., "Sec1:1") so that
--they don't cause
--problems with file naming.
set myPageName to my myReplace(myPageName, ":", "_")
set myFilePath to myFolder & myBaseName & "_" & myPageName & ".pdf"
tell myDocument
--The export command will fail if you provide the file path
--as Unicode text--that's why we had to convert the folder name
--to plain text.
export format PDF type to myFilePath
end tell
Working with Documents in AppleScript
¬
107
¬

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents