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

Check if application buttons are clicked

New Here ,
Apr 06, 2021 Apr 06, 2021

Copy link to clipboard

Copied

Hi, 

 

Hoping that someone can help me with this. I am trying to figure out if, from a document, I can see if application buttons are clicked in Adobe Acrobat. In particular, I would like to see when an attachment is added or removed from the Attachments panel, but I can't seem to check this the way I expected. 

 

I've come up with this bit of code:

if (app.execMenuItem("AddFileAttachment")) {
console.println("success");
}

However, this block seems to actually run app.execMenuItem(), instead of checking to see if it ran. 

 

A little confused both as to why this is happening, but also now wondering if there is a way to read when attachments are added or removed via the Attachment panel that would be best. 

TOPICS
Acrobat SDK and JavaScript

Views

343

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

LEGEND , Apr 07, 2021 Apr 07, 2021

More: execMenuItem does the same thing as clicking on the menu, no more or less. 

There is no feature in Acrobat to allow a document to track the user interface.

There is no feature in JavaScript to allow a script to be notified of document changes.

Votes

Translate

Translate
Community Expert ,
Apr 06, 2021 Apr 06, 2021

Copy link to clipboard

Copied

At Document Open you can read the information of available attachments.

At Document Save you can check any difference at the attachments.

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
LEGEND ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

More: execMenuItem does the same thing as clicking on the menu, no more or less. 

There is no feature in Acrobat to allow a document to track the user interface.

There is no feature in JavaScript to allow a script to be notified of document changes.

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 ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

And it has no return value, so using it in an if-statement is meaningless. It will never return true (or false).

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
New Here ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

LATEST

Was afraid of this, but good to know. Appreciate the confirmation. 

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