Thread View: adobe.scripting.indesign
3 messages
3 total messages
Started by really_randy
Thu, 26 Mar 2009 21:32
Win vs. Mac File Paths
Author: really_randy
Date: Thu, 26 Mar 2009 21:32
Date: Thu, 26 Mar 2009 21:32
25 lines
2043 bytes
2043 bytes
I have a script that Peter Kahrel helped me with (actually he pretty much wrote the whole thing). The script saves out each page of an Indesign doc as jpeg. It also takes the text from a text box tagged "jobnumber" and inserts it into the name of the saved jpeg.
It works great on the Mac. When I move it over to Windows it inserts a weird character before and after the "jobnumber".
On the Mac I can take the folder name which is a variable called 'path' and insert that into the filename as well but it doesn't work on Windows. Does anyone know what the differences are between Mac and Win paths in JS? I tried a few things to no avail.
Here's the script:
==========================================
var path = Folder.selectDialog ("Choose a Folder")
app.jpegExportPreferences.resolution = 72;
app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
app.activeDocument.sections.everyItem().includeSectionPrefix = false;
//path = app.activeDocument.filePath + '/';
p = app.activeDocument.pages.everyItem().getElements();
for (i = 0; i < p.length; i++) { jpg_name = p[i].textFrames.item ('jobnumber').contents + '.jpg';
app.jpegExportPreferences.pageString = p[i].name;
app.activeDocument.exportFile (ExportFormat.jpg, File (path + "/" + jpg_name));
===========================================
As always, Thanks a million,
Randy
}
Re: Win vs. Mac File Paths
Author: really_randy
Date: Thu, 26 Mar 2009 21:53
Date: Thu, 26 Mar 2009 21:53
3 lines
684 bytes
684 bytes
I forgot, here's a screenshot: <http://reallyrandy.com/misc/screenshot2.jpg>
Re: Win vs. Mac File Paths
Author: Peter Kahrel
Date: Sat, 28 Mar 2009 11:18
Date: Sat, 28 Mar 2009 11:18
3 lines
622 bytes
622 bytes
Works fine for me on Windows. Peter
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads