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

Running an external application from javascript

ziongates
Registered: Apr 15 2009
Posts: 17

Why does this not work?

var shell = new ActiveXObject("WScript.shell");
shell.run("notepad.exe");

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
And why do you think you can force someone to run another program from within a PDF?

Adobe has worked hard to prevent security breaches and to protect the user's privacy. Being able to execute an application outside of their application is a huge breach of security and a big privacy issue. The security issue is an unknown program of unknown trust being silently launched with out the user's permission or knowledge. Even a list of 'safe' programs does not prevent a 'safe' program from being replaced by a an unsafe program.

George Kaiser

ziongates
Registered: Apr 15 2009
Posts: 17
This is a personal script. I guess your saying no. Then is it possible to call an external javascript which invokes acrobat funtionality?
Lady Cygnus
Registered: Mar 17 2009
Posts: 19
ziongates wrote:
This is a personal script. I guess your saying no. Then is it possible to call an external javascript which invokes acrobat funtionality?
Based on my own failed attempts I believe the answer to "can I use acrobat scripts with [i]anything[/i] outside of acrobat" is "no".

It appears that the only way to use java/acrobat commands on a file is to use the batch sequences -> java script option.I hope I'm wrong...
Lindy
Registered: Jul 17 2007
Posts: 30
As gkaiseril was pointing out - scripts executing things "outside" of the application are a security issue. That being said, if you truly have the need then look up "Folder Level Scripting", and Trusted Functions. There is quite a lot of power here, but it usually requires the trusted script items be added to the desktop client to facilitate their being called by the PDF for execution.

Good Luck
ziongates
Registered: Apr 15 2009
Posts: 17
thanks