Article View: adobe.scripting.indesign
Article #9626How to name PDF export using InD current file name?
From: Dave_Rioux
Date: Tue, 15 Aug 2006 16:06
Date: Tue, 15 Aug 2006 16:06
24 lines
1840 bytes
1840 bytes
Hello
I'm fairly new to the scripting world, but I'm trying to dive in. I've been using some of the script supplied in the "InDesign CS2 Scripting Guide.pdf" and editing them to suit my needs. However, I am getting stuck on what would seem a simple thing:
I would like to have the Export PDF settings automatically name the PDF file based on the current InDesign document's name. I haven't found this yet in the Reference manual. See the below script, where it automatically names any PDF exported as "myfile.pdf". Not really what i need.
Could anyone tell me how to go about this?
Thank you
//ExportPDF.jsx
//An InDesign CS2 JavaScript
//Assumes you have a document open and that you have defined a PDF export
//preset named "Fat PDF".
//document.export parameters are:
//Format as (use either the ExportFormat.pdfType enumeration
//or the string "Adobe PDF")
//To as File
//ShowingOptions as boolean (setting this option to true displays the
//PDF Export dialog box)
//Using as PDF export preset (or a string that is the name of a
//PDF export preset)
var myPDFExportPreset = app.pdfExportPresets.item("Fat PDF");
app.activeDocument.exportFile(ExportFormat.pdfType, File("/Users/mac/Desktop/myfile.pdf"), false, myPDFExportPreset);
Technical Details
Message-ID:
<3bc144b2.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,1aed37f8dc66a37e,start X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Rioux@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: How to name PDF export using InD current file name? Message-ID: <3bc144b2.-1@webcrossing.la2eafNXanI> Date: Tue, 15 Aug 2006 09:06:47 -0700 Lines: 32 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing