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

script to run a Action Wizard action

Participant ,
Jul 01, 2024 Jul 01, 2024

Copy link to clipboard

Copied

I setup a Action Wizard action in Adobe Acrobat Pro, the purpose is to save the PDF as eps.  I hope open a pdf file , then automatically perform actions, how to do with script?

ruihuang_0-1719817400147.png

 

TOPICS
JavaScript

Views

191

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 , Jul 02, 2024 Jul 02, 2024

Right. The batch process takes care of opening and closing the file(s) for you. You don't need to do that in the code.

This is all you need to add:

this.saveAs({cPath: this.path.replace(".pdf", ".eps"), cConvID: "com.adobe.acrobat.eps"});

Votes

Translate

Translate
Community Expert ,
Jul 01, 2024 Jul 01, 2024

Copy link to clipboard

Copied

Not possible. A script can't run an Action.

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 ,
Jul 01, 2024 Jul 01, 2024

Copy link to clipboard

Copied

You can use a script to perform the same action, though, using the saveAs command, but you can't run it on multiple files, as an Action can.

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
Participant ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

script Acrobat is difficult for me,because it don't like Illustrator , can use "#target illustrator" to executing code. I don't know how to write a javascript to open pdf with Acrobat , then save as eps. 

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
Participant ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

I see a code: var otherDoc = app.openDoc("/c/myDoc.pdf") to open a pdf, but this code how to execute by acrobat ?

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 ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

Why do you want to open the file with code? It would be easier to create a generic script that just saves the current PDF file as an EPS. If you hard-code the path to the file into your code it will be much less useful.

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
Participant ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

My purpose is to batch process save as eps, rather than write a script for each PDF.

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 ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

Right. The batch process takes care of opening and closing the file(s) for you. You don't need to do that in the code.

This is all you need to add:

this.saveAs({cPath: this.path.replace(".pdf", ".eps"), cConvID: "com.adobe.acrobat.eps"});

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
Participant ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

I can use java to open a pdf  file with acrobat. now the difficulty of the problem is how to execute the eps code after opening it, and the next file can still continue to execute eps code. where to set up automatic execution code ?

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 ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

Why Java? You can simply use the Action Wizard. Or are you trying to automate the entire process? If so, Acrobat is not suited for that.

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
Participant ,
Jul 03, 2024 Jul 03, 2024

Copy link to clipboard

Copied

LATEST

TRY67,  thanks a lot, I can use AppleScript to automate the conversion to EPS.
Here is a simple example.

set myFolder to (((path to desktop) as text) & "thScript:temp:")
tell application "Finder"
set pdfFileName to "123_TH.pdf"
set filePath to myFolder & pdfFileName
tell application "Adobe Acrobat"
activate
open file filePath
set AppleScript's text item delimiters to {"_", ".", " "}
set prefix to first text item of pdfFileName
set AppleScript's text item delimiters to ""
set epsName to myFolder & prefix & ".eps"
save document pdfFileName to file epsName using EPS Conversion with embedded fonts, images, preview, separations and annotation without binary given postScript level:3
close document 1 saving no
end tell
end tell

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 ,
Jul 01, 2024 Jul 01, 2024

Copy link to clipboard

Copied

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