Skip to main content
bobl22244579
Participating Frequently
June 18, 2018
Question

Same "Document Will Save" Action on every document?

  • June 18, 2018
  • 3 replies
  • 3472 views

Hello Everyone,

      Our client uses Adobe Acrobat Pro DC at their office and they have a retention policy in place for the documents they keep on their systems in the office. I've written a  script that sets the document info keyword field to the retention period that they've selected.

     Upon saving the document the user is prompted to set the retention policy with a popup. However, this only works if the "Document Will Save" event is set. It's my understanding that the JS in "Document Will Save" is set on a per document basis. I can't expect my clients to set this action on every single document they open.

Is there a way that i can set this action on any document they open from their copy of Acrobat?

All suggestions are welcome!

Thank you so much!   

    Bob

This topic has been closed for replies.

3 replies

BarlaeDC
Community Expert
Community Expert
June 21, 2018

HI,

Thanks that what I thought, and when dealing with metadata, coding defensively is always the call.

Regards

Malcolm

Legend
June 21, 2018

There is no limit and your code is not adequate for the simplest real world file. You definitely should code defensively and expect any section could be megabytes, it happens. Then you won't be surprised.

Bernd Alheit
Community Expert
Community Expert
June 18, 2018

The client can use a script for this.

bobl22244579
Participating Frequently
June 18, 2018

Mr. Alheit,

     Thank you for your quick response.   This needs to be as transparent as possible to the client as they are not likely to be savvy with scripts, etc. I would like for them to be able to hit save and have it prompt them to set the retention policy if it hasn't already been, and that's it.

     I've done all of the scripting work, I just can't figure out how to set the code in Document Will Save for each document, without the user having to do so.

Thanks again!

     Bob

Bernd Alheit
Community Expert
Community Expert
June 18, 2018

Mr. Alheit,

This is unfortunate, I've pored over the vast amounts of documentation you guys have, and I know you probably know this API back and forth.

In your professional opinion can you think of another approach that will accomplish the same general goal of prompting the user without requiring them to set a Document Action for every document they open?

I'm open to alternative solutions.

Thanks!

    Bob


You can create a plug-in for Acrobat. The plug-in can add the script to any open document. The plug-in must be created with C/C++.