Copy link to clipboard
Copied
Is there a script or action that exists that allows me to export both a pdf and an eps at the same time? Currently I'm having to maunally export each induvidually and its becoming very tedious for multiple files. I just want to be able to press command e and export the two file formats at the same time.
Something like the following should work. Execute the script with a document open, make sure the document is saved. It will export the eps and pdf file in the folder where the InDesign file is saved.
if (!app.documents.length)
{
alert("Aborting: No file open");
exit(0);
}
var doc = app.documents[0]
var docPath = doc.fullName.fsName;
doc.exportFile(ExportFormat.EPS_TYPE, File(docPath.replace(/\..*$/,".eps")));
doc.exportFile(ExportFormat.PDF_TYPE, File(docPath.replace(/\..*$/,".pdf")), fals
...
Copy link to clipboard
Copied
Something like the following should work. Execute the script with a document open, make sure the document is saved. It will export the eps and pdf file in the folder where the InDesign file is saved.
if (!app.documents.length)
{
alert("Aborting: No file open");
exit(0);
}
var doc = app.documents[0]
var docPath = doc.fullName.fsName;
doc.exportFile(ExportFormat.EPS_TYPE, File(docPath.replace(/\..*$/,".eps")));
doc.exportFile(ExportFormat.PDF_TYPE, File(docPath.replace(/\..*$/,".pdf")), false);
-Manan
Copy link to clipboard
Copied
Thank you so much Manan! That worked great!
Vinh
Copy link to clipboard
Copied
Why do you need EPS in modern days? Avoid the use of it.
Copy link to clipboard
Copied
I appreciate your help, but this is the file format requested by the engraver.
Copy link to clipboard
Copied
So this script works great when I'm working from a local folder. I get this error when I'm working from a google drive folder. Is there a way to remedy this?
Copy link to clipboard
Copied
Could be a file permission issue. Does that folder have permission to write? Try exporting a pdf from InDesign into that folder using the UI menu and see if it works.
-Manan
Copy link to clipboard
Copied
I definitely have write permissions as I am able to export using the regular indesign ui.
Copy link to clipboard
Copied
Try the script below, it will alert the path where the scrit is trying to save the files. Check if the path is correct or not.
if (!app.documents.length)
{
alert("Aborting: No file open");
exit(0);
}
var doc = app.documents[0]
var docPath = doc.fullName.fsName;
alert(File(docPath.replace(/\..*$/,".eps")))
alert(File(docPath.replace(/\..*$/,".pdf")))
-Manan
Copy link to clipboard
Copied
So I didn't get an error, but this window came up instead:
When I press OK, another window just like this comes up again but no action occures. When i press OK again on the second window, it closes and nothing happens.
Vinh
Copy link to clipboard
Copied
That's interesting, this shows that the InDesign file does not seem to have a name at all. What happens with the following code
if (!app.documents.length)
{
alert("Aborting: No file open");
exit(0);
}
var doc = app.documents[0]
var docPath = doc.fullName.fsName;
alert(docPath)
-Manan
Copy link to clipboard
Copied
I get this window. with the filepath to the document. It shows the document name.
Copy link to clipboard
Copied
I tried creating a test file and executing the original script in "my drive" that lives outside of the shortcut and it works. I'm assuming its the google drive shortcut that's messing things up?