I was hoping to be able to access a directory on a network drive. For example, I want an employee to be able to fill out a form and place a link into a field of where the documents are that they have been working on. I then want a supervisor to be able click a button and access that folder to check the work.
I noticed that this link had a work around: http://forums.adobe.com/message/1359940#1359940
I would be okay using a work around but I'm unsure how to actually create a trusted function as the person explains in that post.
Do you know how to make that workaround around work?
Not sure if that's doable or not, hopefully someone who knows more will pop into the thread.
I've not tried using the trusted function method for accessing files but you could check the following post from Radzmar, it's for saving a file but there might be something there you can use.
Finally figured this out using the work around located here: http://forums.adobe.com/message/1359940#1359940
I used the simplest form of this to get it to work.
You need to create a openFolder.js file in a text editor like notepad++ and then copy the text below into it:
var openFolder = app.trustedFunction(function (sURL)
var nDoc = app.launchURL("file:///" + sURL, true);
var myPath = TextField1.rawValue;
You should now be able to place a path in the text field and press the button to follow it. This only works for paths that have forward slashes in them (/). This means if you paste a path from windows you will need to manually convert the backslahes to forward slashes. Or you can do some string editing when you call the function to replace all \ with /.
This method also works with files.
You can add
var myPath = myPath.replace(/\134/g,"/");
to convert backslahes to forward slashes
Currently this will not handle paths with spaces in them... Does anybody have an idea on how to make it work with spaces?