You can write a document-level function into the actions handlers using the doc.setAction() method from a folder-level script, but one folder-level script cannot create another.
Suppose you have a folder-level function triggered by a menu item, and it has collected a reference to the active document as oDoc:
var myScript = 'console.println("I am about to be printed and I have " + this.numPages + " pages" );';
I tried to embed the script "this.setAction("WillPrint",app.alert("hi");)", but this script does not get executed when i open the print console from the acrobat reader. not sure what's wrong. Quick advise will be greatly helpful.
to execute the app.alert at the time setAction is called, and to set an empty action. The action needs to be something that is NOT executed immediately (e.g. string).
Europe, Middle East and Africa