Skip to main content
Participating Frequently
April 2, 2019
Question

HelIo, I have an Attachment button but I would like the attachment name to show in a text box. The attachment is mandatory but I'm not sure how to do this. Can you help me please? Thank you. JB.

  • April 2, 2019
  • 1 reply
  • 625 views

HelIo, I have an Attachment button but I would like the attachment name to show in a text box. The attachment is mandatory but I'm not sure how to do this. Can you help me please? Thank you. JB.

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
April 2, 2019

There are a couple of ways to do this. For example, put this code in a folder level script.

this.getField("AttachName").value = dataObjects[0].name;

This code puts the "name" of the first attachment into a field named "AttachName".

You'll need to change the field name to match the one on your PDF.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
JaybrewcaAuthor
Participating Frequently
April 3, 2019

Hello Thom,

     Tank you for your response. Forgive my ignorance but, I Don't know what you mean by "Folder level " script. Could you enlighten me?

John

JaybrewcaAuthor
Participating Frequently
April 4, 2019

You cannot skip steps... You must add the document level script, because it is what makes import_pre_11 and import_11 work. What version of Acrobat Pro do you have (if you have Acrobat Standard, get Acrobat Pro).


Hello sir,
Thank you for your assistance.

I have found a solution as you can see below.

JOhn