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

Confused about security restrictions

adam_s
Registered: Dec 17 2009
Posts: 2

I'm not sure why this doesn't work, as by my understanding of the documentation, it should.

I want to pop up a file browser as a part of a batch sequence. Inside this batch, I have a single Execute Javascript command, with the following script:
app.browseForDoc();

When I run the batch sequence, the Javascript debugger gives an error:
NotAllowedError: Security settings prevent access to this property or method.
app.browseForDoc:1:Batch undefined:Exec

BTW: Running Acrobat 8.

My Product Information:
Acrobat Pro 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
For this particular issue the documentation is not complete. Actually the documentation is not complete for quite a few things. But the gist of the issue is that batch processes are supposed to be un-interupted, and even though a batch process is automatically a privileged execution context, Acrobat has an extra layer of security for certian operations, app.browseForDoc() happens to be one of these.

However, I was able to get it to work by placing the app.browseForDoc() function in a "trustedFunction" in a folder level script. And then calling the function from the batch process.

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