Article View: adobe.scripting.indesign
Article #9657Select filename for EPS export (JS)
From: John_Kordas
Date: Thu, 20 Jul 2006 03:53
Date: Thu, 20 Jul 2006 03:53
36 lines
2301 bytes
2301 bytes
After completing my first JavaScript yesterday I thought I�d keep the momentum and create a second script to the first script. I�m creating this for CS2 and what the first script did was allow you to select a file then key in the size of the doc you want to place it in at the same time select the scaling option you would like to used once the files was placed.
It also shows the path and the file name in the dialog box.
Path:
staticTexts.add({staticLabel:"Source File:", minWidth:myLabelWidth});
staticTexts.add({staticLabel:myFile.path + "/"});
Filename:
staticTexts.add({staticLabel:"File Name:", minWidth:myLabelWidth});
staticTexts.add({staticLabel:myFile.name});
To get the file:
var myFile = File.openDialog("Choose a File to Place");
if(myFile == null){alert("Please select a file and then try again."); exit();}
To place the file in the frame.
myFile = myFrame.place( File(myFile), false );
The second script will allow the user to export an EPS and it will use the file name of the file placed in the document. The only options form the export process required is the postscript level and color. I�ve created the dialog screen and using the Path and Filename script above to flag the source.
myFile = app.activeDocument.rectangles.item;
Returns undefined for the source, and item for the name in the dialog.
Do I need to refer to the frame?
Also I seem to be able to export to my local drive using
if(app.activeDocument.modified == true){app.activeDocument.exportFile("EPS", "C:\myTestDocument.eps");
}
If I try and get it to save to a server it does not seem to work.
Can you use \\prodserver\test\ myTestDocument.eps
Regards, John.
Technical Details
Message-ID:
<3bc0f93e.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news1.google.com!news.germany.com!feeder.news-service.com!syros.belnet.be!news.belnet.be!news.stben.net!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,2098e96800d90d37,start X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII From: John_Kordas@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Select filename for EPS export (JS) Message-ID: <3bc0f93e.-1@webcrossing.la2eafNXanI> Date: Wed, 19 Jul 2006 20:53:08 -0700 Lines: 47 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!news1.google.com!news.germany.com!feeder.news-service.com!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing