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

JavaScript Debugger, app.getPath, NotAllowedError

twhall
Registered: Jan 25 2008
Posts: 2
Answered

I'm looking at "Developing Acrobat Applications Using JavaScript", page 42. In the JavaScript Debugger Console, I try to execute the statements

app.getPath("app", "javascript");
app.getPath("user", "javascript");

but there's no reaction to anything I type in the console. I put the statements in a ".js" file in what I guessed was the application JavaScript folder:

C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Javascripts\AppTest.js

and restart Acrobat. Now I get:

Exception in line 1 of function top_level, script Folder-Level:App:AppTest.js

NotAllowedError: Security settings prevent access to this property or method.
App.getPath:1:Folder-Level:App:AppTest.js

In the Acrobat preferences, I have set:

Enable Acrobat JavaScript
Enable JavaScript debugger after Acrobat is restarted (and I have restarted)
Enable interactive console

What am I missing:

* in regard to using the console?
* in regard to using app.getPath?

[Acrobat 8 Pro 8.1.1, Windows XP SP2]

My Product Information:
Acrobat Pro 8.1.1, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
To execute JavaScript entered into the JavaScript Debugging console, one needs to highlight the text and press the numeric keypad "Enter" key or the "Ctrl-Enter" key combination. See the section in the JS Scripting Guide titled "Executing JavaScript".

George Kaiser