• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

PDF Form Button to run Privileged Script

Explorer ,
Jun 06, 2019 Jun 06, 2019

Copy link to clipboard

Copied

I just got quite a bit of help on another thread and got my script up and running perfectly (Here is the link if anyone wants context: Saving PDF form to specific folder based on field data ).

Now, I'm wanting to run this script via a form button but I'm running into the expected privilege issues you'd expect since I'm running it as Trusted. Is there anything I need to do to my code to make this possible or is it a security setting that will need to be changed?

Here is the script: [JavaScript] Attempt - Pastebin.com

Thanks again everyone, y'all have been a huge help!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

661

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 06, 2019 Jun 06, 2019

Read this article:

Trust and Privilege in Acrobat Scripts

You'll find more info on creating buttons and other automation script features here:

Alerts, Popups, and Other Devices for Interacting with the User

Automating Acrobat can save you loads of time.

Votes

Translate

Translate
Community Expert ,
Jun 06, 2019 Jun 06, 2019

Copy link to clipboard

Copied

Read this article:

Trust and Privilege in Acrobat Scripts

You'll find more info on creating buttons and other automation script features here:

Alerts, Popups, and Other Devices for Interacting with the User

Automating Acrobat can save you loads of time.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2019 Jun 06, 2019

Copy link to clipboard

Copied

Thanks for the links, Thom. The best I can glean from the info is that I should add the file location of the PDFs I'll be adding this button to to Trusted Locations, as the button added and the script it runs are all part of the PDF and would then have the privileges needed. Does that sound about right?

I'll try it when I get into work tomorrow.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 06, 2019 Jun 06, 2019

Copy link to clipboard

Copied

Yes, it's either that or use a folder level script. Or certify the document with a cert marked for JavaScript privilege.

I always use a folder level script.

BTW: there is never a case where you need to define a "trustedFunction" in a document script. Because if the document is marked as trusted, then all code in the doc is in a privileged context. If not, then it'll never work because a "trustedFunction" requires a privileged context to get defined in the first place.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2019 Jun 06, 2019

Copy link to clipboard

Copied

LATEST

Awesome, thanks for that info! I have a folder level file for it and have submenu/menuitem code for it as well that works fine, but I'm trying to make it more usable with a form button for the older, not tech savvy guys in the warehouse I work in. I also don't want to step on the toes of the IT fella who already takes issue with me making these scripts in the first place. I'll try a few of these things tomorrow to see what'll the least intrusive (so I don't get another passive aggressive phone call, haha) and get it working.

I appreciate your time!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines