• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Where can I save my folder-level user JavaScripts? Path is missing...

Explorer ,
Jul 12, 2017 Jul 12, 2017

Copy link to clipboard

Copied

The documentation says to use the config.js file. I can't find a path for this. I tried app.getPath("user","javascript"); and got an error. I'm running Acrobat Pro DC continuous release on a Windows 10 machine.

I can find the app js file, but Adobe doesn't allow me to save my scripts there.

I need to save to the folder-level to run a Net.HTTP request.

Thanks!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 13, 2017 Jul 13, 2017

You need to use the "app" folder, not the "user" folder.

Votes

Translate

Translate
LEGEND ,
Jul 13, 2017 Jul 13, 2017

Copy link to clipboard

Copied

What error exactly?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2017 Jul 13, 2017

Copy link to clipboard

Copied

You need to use the "app" folder, not the "user" folder.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 13, 2017 Jul 13, 2017

Copy link to clipboard

Copied

LATEST

Here's more details on the issue and the correct answer for anyone who needs additional clarification.

My first attempt at saving my script to a folder-level file did not work because Acrobat was open. These scripts are loaded when the application initializes, and are not authorized to be edited while Acrobat is running.

I also tried to save it to the wrong file. I searched for a config.js file and found one here (don't use this file!):

C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\WebResources\Resource0\static\js

Looking through old documentation and info on the web, I thought I had to save it to a user folder. This worked for older versions of Acrobat but does not work for Acrobat DC.

Upon try67's suggestion, I ran app.getPath("app","javascript"); and on my computer, which is running Windows 10, it returned:

C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts

This is the correct location. On Mac or older versions of Windows, the location may be different. Run the app.getPath function to find it.

To make and edit my config.js file, I simply created the file in another location (desktop is convenient), and after saving, dragged it into the folder I referenced above. This action prompts the user to authenticate from an administrative account. Once authenticated, the file is copied and Acrobat can then be opened, and it will load with the scripts. If I need to make more edits, I can close Acrobat, drag the file back onto my desktop and edit it from there.

Thanks try67 for the prompt, very helpful reply!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines