Article View: adobe.scripting.indesign
Article #446Save each page as PDF naming mod
From: really_randy
Date: Tue, 24 Mar 2009 21:22
Date: Tue, 24 Mar 2009 21:22
27 lines
2071 bytes
2071 bytes
I had an issue I needed help with a while back, now I need to mod the script.
Here's the original post
Peter Kahrel, ""Save each page as PDF" naming mod?" #1, 16 Jan 2008 8:00 am </webx?14@@.3bbf275d.3c05d51a/0>
I have a 456 page document that was made from a data merge. It has a background image, a foreground image and a job number/description.
I need to save each page out as a jpg and name the file with the contents of the "jobnumber" text box. Previously Peter Kahrel helped me out tremendously with a little function that looked at the job number (which was always PNXX-xxxx) and swapped it out with the real job number.
Now the contents of the jobnumber field isn't structured, i.e., "AvocadoSwirl_V", or "BurntSienna_G".
Is there a way to set a script label for the "jobnumber" text box and just name the output file whatever is in there?
Here is the existing script:
var destinationFolder = Folder.selectDialog ("Choose a Folder");
var myPDFExportPreset = app.pdfExportPresets.item("WebVidOverlay");
doc = app.activeDocument;
doc.sections.everyItem().includeSectionPrefix = false;
app.findTextPreferences = null;
app.findTextPreferences.findWhat = 'pnxx^9^9^9^9';
found = doc.findText();
for (i = 0; i < found.length; i++ ) { f = File (destinationFolder + "/" + found[i].contents + '.pdf'); app.pdfExportPreferences.pageRange = found[i].parentTextFrames[0].parent.name; doc.exportFile (ExportFormat.pdfType, f, false, myPDFExportPreset); }
As always, Thanks a million,
Randy
Technical Details
Message-ID:
<59b865f5.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,5351a1eac154099d,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: really_randy@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Save each page as PDF naming mod Message-ID: <59b865f5.-1@webcrossing.la2eafNXanI> Date: Tue, 24 Mar 2009 14:22:12 -0700 Lines: 41 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit