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

Adding a script to the Doc/WillClose only works once

New Here ,
Jun 06, 2018 Jun 06, 2018

I have some code in my document action "WillClose", but my script is called only once. Why this is happening?

I have Acrobat DC.

TOPICS
Acrobat SDK and JavaScript
583
Translate
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, 2018 Jun 06, 2018

The script will only run once when the document is about to close. When would you expect the script to run? You will have to open the document again, and then try to close to have the script triggered again.

Translate
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
New Here ,
Jun 06, 2018 Jun 06, 2018

Thanks, even though I have some changes and when Adobe ask me if I want to save my changes I answer "Cancel"

Translate
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
LEGEND ,
Jun 07, 2018 Jun 07, 2018

Ah you mean WillClose is not called again if you cancel closing, then close again? Odd, I‘d expect WillClose to be called only after an affirmative prompt, hence still only once but when it really closes.

Translate
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
New Here ,
Jun 07, 2018 Jun 07, 2018
LATEST

Test Screen Name,

                               that's exactly what I want.

According to Adobe, WillClose is trigger BEFORE.

WillClose "Triggered immediately before the PDF is closed."

https://acrobatusers.com/tutorials/entering-document-actions

thank you all for your responses. Help me a lot.

Translate
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 07, 2018 Jun 07, 2018

I've seen this issue reported before. It seems to be a bug in Acrobat.

Translate
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