Skip to main content
Participant
December 3, 2018
Answered

Open finder location by button, based on field value

  • December 3, 2018
  • 1 reply
  • 957 views

Hi There,

I have created a form with fields (Mac - Acrobat pro 2019). One of them is a text field (name=serverpath) where people can paste a server path in (is an Apple File Protocol path). Next to that field is a button (name=button1) which needs to open a finder screen with the location of "serverpath".

If nothing is filled in, there should be a dialog box saying you have to fill in a path.

Does somebody has a suggestion or a solution? Help is very welcome!!

Thanks in advance!

This topic has been closed for replies.
Correct answer try67

No.

1 reply

Thom Parker
Community Expert
Community Expert
December 3, 2018

One on the options on Text Field Properties is "Field is used for File Selection". This option can be used in conjunction with JavaScript to open a file selection dialog (i.e. Finder on Mac), however, the initial location cannot be set. This is not an option in Acrobat.

The JavaScript function is "field.browseForFileToSubmit()"

Here's the JS reference entry

Acrobat DC SDK Documentation

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
December 4, 2018

Thanks for the reply, I will take a look at it!