Skip to main content
Known Participant
January 29, 2017
Question

accessing a variable from differebt buttons

  • January 29, 2017
  • 1 reply
  • 771 views

Hello,

I would like to run a method which returns an array on opening the pdf file. Then I would like to access the returned array from different buttons.

How can I do it?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 29, 2017

If you define the variable at the doc-level (not inside a function), it should be available to all other code later on.

Known Participant
January 30, 2017

But how?

try67
Community Expert
Community Expert
January 30, 2017

Doc-level script:

var a = "abc";

Button-level script:

app.alert(a);