Adobe Acrobat Reader DC Javascript folder
Copy link to clipboard
Copied
Hi,
I have been working on some folder-level scripts for a Win10 device which is using a free license of Acrobat Reader DC. I've tried to locate the 'Javascripts' folder on both user and app levels but both are undefined when I used the 'app.getPath("user","javascript");/app.getPath("app","javascript")' functions in the javascript console. I've even tried to manually create directories for them under "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\Javascripts" and "C:\Users\<user>\AppData\Roaming\Adobe\Privileged\DC\Javascripts" and other variants I stumbled across the internet but to no avail. The app just doesn't seem to recognise my .js file no matter where I put it. The current build version of Reader DC for this device is 2020.009.20074
Please help.
Thanks.
Copy link to clipboard
Copied
What does you use in the .js file? In the preferences of Acrobat Reader is Javascript enabled?
Copy link to clipboard
Copied
I have enabled Javascript in the preferences and everything else that's available on the free Reader but I'm not sure that they help. My .js file uses a standard trusted function for a saveAs function, based off the one seen below:
var mySaveAs = app.trustedFunction( function(oDoc,cPath,cFlName) { app.beginPriv(); // Ensure path has trailing "/" cPath = cPath.replace(/([^/])$/, "$1/"); try{ oDoc.saveAs(cPath + cFlName); }catch(e){ app.alert("Error During Save"); } app.endPriv(); } );
Thanks.
Copy link to clipboard
Copied
Any issue using this function?
Have you created the .js file at "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\Javascripts" or "C:\Users\<user>\AppData\Roaming\Adobe\Privileged\DC\Javascripts" ?
Copy link to clipboard
Copied
The issue is they don't know where to put the .js file that contains it...
Copy link to clipboard
Copied
The function works fine when I use it on my main Win10 device which I used to build the function. That machine has Adobe Acrobat Pro 2020. I already put copies of the .js file in both those directories you mentioned.
Copy link to clipboard
Copied
At the begin of the .js file add this line:
app.alert("test");
What happens when you start/run Acrobat Reader?

