These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

javascript folder location help

mfilip
Registered: Apr 14 2009
Posts: 2

We have a custom made javascript that needs to be placed in the javascript folder for about 200 computers. The problem is that many of our computers have different versions of Adobe installed on their computer, anywhere from version 6 to version 9, some full versions and many just Reader only. We have a batch file that copies the javascript to the correct javascript folder for version 6 but if anyone has version 7-9, then of course the batch file won't work for them.

Our inclination is to have someone write a batch file to test for each version someway and copy the javascript to the appropriate version javascript folder location. The problem is that many of our folks had upgraded over the years from version 6-7-8 so older (probably unused?) versions of Acrobat folders still exist on their machine.

Should we do something related to our thoughts above or is there some place in the system (system variable, registry) that we can check to see where the 'current' javascript folder location is? All of our machines or XP.

Any and all suggestions are welcome. Our 'programming' experience is limited to DOS batch file commands though.

My Product Information:
Acrobat Standard 6.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2399
You can write a script that searches the system for Acrobat.exe and then places the script in the javascripts subfolder of it's location. It's probably also possible to do by checking in the registry which application is associated with PDF files.
From within Acrobat you can it this path by running app.getPath("app","javascript") obviously you want to achieve this from outside of Acrobat...

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
There are 2 possible locations for folder level JavaScripts with Acrobat/Reader, the "application" and the "user" folders. The "Application" folder is located in the Acrobat/Reader application folder and the scripts in this folder apply to all user. The "User" folder level JavaScripts reside in the logged on user's application folder for Acrobat/Reader and are only available to that specific users and not other users.

Form within the Acrobat JavaScirpt console, one can see the different folders using the 'getPath()' method of the 'app' object to see the application folder location and the user location is there are any user level JavaScirpts.



// get the 'application' level JavaScript folders if it existtry {var appJS = 'The application JS folder is:\n' + app.getPath("app","javascript"); // try to get the folder} catch(e) { // error raised if the folder does not existvar appJS = "The application has no defined any application level JavaScripts";}console.println(appJS); // get the 'user' level JavaScript folder if it existtry {var userJS = 'The user JS folder is:\n' + app.getPath("user","javascript"); // try to get the folder} catch(e) { // error raised if the folder does not existvar userJS = "User has not defined any user level JavaScripts";} console.println(userJS); // to use an app alert and not the console:app.alert('Folder level JavaScirpt locations: \n\n' +appJS +'\n\n' + userJS, 3, 0);

The console output for version 8 with user level JavaScripts:
Quote:
The application JS folder is:
/C/Program Files/Adobe/Acrobat 8.0/Acrobat/JavaScripts
The user JS folder is:
/C/Documents and Settings//Application Data/Adobe/Acrobat/8.0/JavaScripts

George Kaiser