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

Replace Pages

Explorer ,
Jan 02, 2020 Jan 02, 2020

Copy link to clipboard

Copied

Hi i just need to show up dialog window.
Because its impossible to set shortcut to replace pages, all i need is show dialog windows. The same dialog window when i click on replace pages, window has name CZ - Vyberte soubor s novými stránkami ENG - Select File With New Pages. Can some one please post JS code? I believe it will be 3 lines code max. The rest i will do with AutoHotkey script.
Many Thanks
EDIT:  in active document of course 🙂

Screen here:
https://ctrlv.cz/hLzy

TOPICS
Acrobat SDK and JavaScript

Views

1.1K

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 , Jan 02, 2020 Jan 02, 2020

The JavaScript menu item runs JavaScript. Just typing in "ReplacePages" doesn't do it. 

 

The JavaScript you need was provided by Try67.  So here's what your code needs to look like:

 

app.addMenuItem ({cName: "Nahradit stránky", cParent: "Edit", cExec: 'app.execMenuItem("ReplacePages")'});

 

Note the change in quotes. This is necessary because the execMenuItem code uses a quoted string, and is itself quoted. 

 

Here's an article on how this is done:

https://acrobatusers.com/tutorials/print/add_custom_menu_items/

...

Votes

Translate

Translate
Community Expert ,
Jan 02, 2020 Jan 02, 2020

Copy link to clipboard

Copied

app.execMenuItem("ReplacePages");

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
Explorer ,
Jan 02, 2020 Jan 02, 2020

Copy link to clipboard

Copied

Thank you, BUT...  🙂
i cant add a shortcut even a Javascript so i tried created new menu item (then i can use Autohotkey) but can you help me with this please:
app.addMenuItem ({cName: "Nahradit stránky", cParent: "Edit", cExec: "ReplacePages" });
I get a error: internal error.

https://ctrlv.cz/wRqK

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 ,
Jan 02, 2020 Jan 02, 2020

Copy link to clipboard

Copied

The JavaScript menu item runs JavaScript. Just typing in "ReplacePages" doesn't do it. 

 

The JavaScript you need was provided by Try67.  So here's what your code needs to look like:

 

app.addMenuItem ({cName: "Nahradit stránky", cParent: "Edit", cExec: 'app.execMenuItem("ReplacePages")'});

 

Note the change in quotes. This is necessary because the execMenuItem code uses a quoted string, and is itself quoted. 

 

Here's an article on how this is done:

https://acrobatusers.com/tutorials/print/add_custom_menu_items/

And you can find out lots more about creating automation tools for Acrobat Here:

https://www.pdfscripting.com/public/Automating-Acrobat.cfm

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
Explorer ,
Jan 04, 2020 Jan 04, 2020

Copy link to clipboard

Copied

LATEST

Splendid!
Many Thanks

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