• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Export pdf and eps at the same time

New Here ,
Mar 04, 2022 Mar 04, 2022

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. 

TOPICS
Feature request , How to , Import and export , Scripting

Views

366

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 04, 2022 Mar 04, 2022

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
...

Votes

Translate

Translate
Community Expert ,
Mar 04, 2022 Mar 04, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 04, 2022 Mar 04, 2022

Copy link to clipboard

Copied

Thank you so much Manan! That worked great!

 

Vinh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 07, 2022 Mar 07, 2022

Copy link to clipboard

Copied

Why do you need EPS in modern days? Avoid the use of it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2022 Mar 07, 2022

Copy link to clipboard

Copied

I appreciate your help, but this is the file format requested by the engraver. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2022 Mar 07, 2022

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?

Screen Shot 2022-03-07 at 6.50.00 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 07, 2022 Mar 07, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2022 Mar 07, 2022

Copy link to clipboard

Copied

I definitely have write permissions as I am able to export using the regular indesign ui. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 07, 2022 Mar 07, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

So I didn't get an error, but this window came up instead:
Screen Shot 2022-03-09 at 11.13.35 PM.png

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 09, 2022 Mar 09, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

Screen Shot 2022-03-09 at 11.25.31 PM.png

I get this window. with the filepath to the document. It shows the document name.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

LATEST

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines