Adobe 27510753 Scripting Guide - Page 181
Exporting s as EPS, Exporting all s, Exporting a range of s
![]() |
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 181 highlights
Adobe InDesign CS2 Scripting Guide Working with Documents in VBScript 173 End If Function myExportPages(myInDesign, myDocument, myFolderName) myDocumentName = myDocument.Name Set myDialog = myInDesign.Dialogs.Add With myDialog .Name = "ExportPages" With .DialogColumns.Add With .DialogRows.Add With .StaticTexts.Add .StaticLabel = "Base Name:" End With Set myBaseNameField = .TextEditboxes.Add myBaseNameField.EditContents = myDocumentName myBaseNameField.MinWidth = 160 End With End With End With myResult = myDialog.Show If myResult = True Then myBaseName = myBaseNameField.EditContents Rem Remove the dialog box from memory. myDialog.Destroy For myCounter = 1 To myDocument.Pages.Count myPageName = myDocument.Pages.Item(myCounter).Name myInDesign.PDFExportPreferences.PageRange = myPageName Rem Generate a file path from the folder name, the base document name, Rem and the page name. Rem Replace the colons in the page name (e.g., "Sec1:1") wtih underscores. myPageName = Replace(myPageName, ":", "_") myFilePath = myFolderName & "\" & myBaseName & "_" & myPageName & ".pdf" myDocument.Export idExportFormat.idPDFType, myFilePath, False Next Else myDialog.Destroy End If End Function 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). Exporting all pages The following script exports the pages of the active document to one or more EPS files: Rem ExportAsEPS.vbs Rem An InDesign CS2 VBScript. Rem Exports the pages of the active document as a series of EPS files. Set myInDesign = CreateObject("InDesign.Application.CS2") myFile = "c:\myTestFile.eps" myInDesign.ActiveDocument.Export idExportFormat.idEPSType, myFile, False Exporting a range of pages To control which pages are exported as EPS, set the PageRange property of the EPS export preferences to a page range string containing the page or pages that you want to export before exporting: Rem ExportPageRangeAsEPS.vbs
![](/manual_guide/products/adobe-27510753-scripting-guide-5f6265c/181.png)