I am trying to pass a value from one script to another and am not very familiar with how to do so. I am thinking it will be a matter of using a global variable but if anyone could help I would appreciate it.
I have the following script called "highlight functions"...here is the code for that script...
var grids = new Array();
var buttPages = new Array();
initgrids();
nogrids();
function nogrids(){
for(var i=0;i
Now heres the critcal information:
Where is this code located, i.e. the code where the data will be shared across? Is it in a document level script? a folder level script? A button Script? Same document? different documents? This is the real and only data you need to provide because the sharing mechanism depends entirely on the locations of the code.
Since it appears that data is being shared between two pieces of code within the same document context the best place to put the shared data is in a document level variable. There are two ways to create a document level variable.
1. Declare a variable in a document level script
2. Use the "this.varName" notation to attach the data to the document object.
One more thing. At the top of your code the two functions "initgrids()" and "nogrids()" are called before they are defined. These functions must be defined before they are called.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script