Hello,
I created a toolbar button using a code similar to this (inside an app.trustedFunction):
app.addToolButton({
cName: "applyMetaData",
cLabel: "MetaData",
cEnable: "event.rc = (app.doc != null);",
cExec: "function_name();"});
So, after my pdf is open, The toolbar will display this button.
However, after that, I would like to control the enable/disable state of this button. Is this possible?
I tried to use a reference to the button variable, but I realized that despite being able to read the properties of the button (and actual, setting them), I cannot enable/disable the button.
Thank you.
some questions.
1) What do you mean by "after my pdf is open, The toolbar will display this button"?
You defined a trusted function for button creation in a folder level Script. Are you calling the function from a document script, or is the button created when Acrobat is started.
2) What do you mean by "tried to use a reference to the button variable"?
As far as I know, no such animal exists in Acrobat JavaScript.
Thom Parker
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script