Skip to main content
Known Participant
Jan 29, 2017 10:54 PM UTC
Question

accessing a variable from differebt buttons

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 is closed to new replies. Start a new post to keep the conversation going.

7 replies

try67
Community Expert
Community Expert
Jan 29, 2017 11:05 PM UTC

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

Translate
Known Participant
Jan 30, 2017 5:30 AM UTC

But how?

Translate
try67
Community Expert
Community Expert
Jan 30, 2017 10:28 AM UTC

Doc-level script:

var a = "abc";

Button-level script:

app.alert(a);

Translate