Skip to main content
Inspiring
January 2, 2020
解決済み

Replace Pages

  • January 2, 2020
  • 返信数 1.
  • 1849 ビュー

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

このトピックへの返信は締め切られました。
解決に役立った回答 Thom Parker

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

返信数 1

try67
Community Expert
Community Expert
January 2, 2020

app.execMenuItem("ReplacePages");

zuzu_kuc1作成者
Inspiring
January 2, 2020

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

Thom Parker
Community Expert
Thom ParkerCommunity Expert解決!
Community Expert
January 2, 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/

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 PDFScriptingUse the Acrobat JavaScript Reference early and often