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

fso = new ActiveXObject("Scripting.FileSystemObject"); doesn't work

CL
Registered: Mar 8 2011
Posts: 3
Answered

Dear all
 
I'm using LiveCycle Designer 8.0, purpose to add all subfolder names of a specific folder to a drop-down list, but failed to create a FileSystemObject, my code as below, the message "Testing" never pop-up, i.e. code stopped at previous line. Thx!
 
CL
 
----- form.Page1.#subform[1]::initialize: - (JavaScript, client) -----------------------------------
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
xfa.host.messageBox("Testing", "Debugging", 3);

CL

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The "ActiveXObject" is an object in the Windows Scripting Model. Scripts in a LiveCycle form operate in the LiveCycle and Acrobat Scripting model. The two are completely unrelated.

Further, for security reasons the Acrobat environment is heavily sandboxed. There is no direct access to the local file system. If there were, then scripts in a PDF could be used to distribute malicious software. There are a great number of things that cannot be done from a document script for exactly this same reason.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

CL
Registered: Mar 8 2011
Posts: 3
Thx Thomp, can I said there is no way in Acrobat or LiveCycle to retreive a list of all subfolder names of a specific folder?

CL

CL

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accepted Answer
That is correct, there is not way a script on a document can retrieve a list of folders from the local file system.
The Acrobat JavaScript model does not provide any functionality for doing this.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script