🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1490

Export individual PDFs and save to a specified folder location?????

#1490
From: James_Leyland
Date: Wed, 11 Feb 2009 12:40
48 lines
2229 bytes
=====================================================================
Export individual PDFs and save to a specified folder location?????
=====================================================================

Hey guys,

I was wondering if anyone knows of a way in which I can get Indesign CS3 to save to a specified location when exporting a PDF?

I am currently using a data merge prior to running my java script to export a set number of pages to individual PDFs, but i am struggling to get it to save these PDFs to a specified folder location.

The code I am using to export the PDFs looks like this:

var SectionLength = 4;

for (var p=0; p<app.activeDocument.pages.length; p += SectionLength)

{
	var currentpage = app.activeDocument.pages[p];
	var textframe = currentpage.textFrames.item("Company Name");
	var companyname = textframe.contents;
	var textframe2 = currentpage.textFrames.item("PDF Description");
	var pdfdescription = textframe2.contents;
	//alert(textframe.contents);

	with(app.pdfExportPreferences)

	{

		if (p+SectionLength-1 > app.activeDocument.pages.length)

			pageRange = app.activeDocument.pages[p].name+"-"+app.activeDocument.pages[app.activeDocument.pages.length-1].name;

		else

			pageRange = app.activeDocument.pages[p].name+"-"+app.activeDocument.pages[p+SectionLength-1].name;

		theFile = new File(companyname+" - "+pdfdescription+".pdf");

		app.activeDocument.exportFile (ExportFormat.pdfType, theFile, false);

	}

}

Any help would be great as I'm new to this scripting stuff and can't quite get it too work.

Thanks very much for your help!
James
Technical Details
Message-ID: <59b7e19a.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,4a145d3ce01d4c60,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: James_Leyland@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Export individual PDFs and save to a
 specified folder location?????
Message-ID: <59b7e19a.-1@webcrossing.la2eafNXanI>
Date: Wed, 11 Feb 2009 04:40:33 -0800
Lines: 55
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit