Skip to main content
Known Participant
August 27, 2017
Question

How figure out when there are no more active docs

  • August 27, 2017
  • 2 replies
  • 1472 views

HI,

I want to use app.activeDocs to detect when there are no more active pdf's.  I tried putting:

if (dd.length == 0)

if (dd.length == null)

if (dd.length == false)

if (dd.length <1)

if (dd.length !=1)

into the following code:

{

   app.beginPriv();

var dd = app.activeDocs

if (dd.length ==0)

{

app.alert ("hi")

}

     app.endPriv();

   });

Note I cannot use folder level scripts as I am unable to get permission to put on user's computers.

Using Acrobat X Pro

This topic has been closed for replies.

2 replies

Inspiring
August 27, 2017

You should be able to get to the user's JavaScript folder since this where users add stamps through the manage stamps. You may need to create the user JavaScript folder.

For Acrobat/Reader DC:

C:\Users\[userid]\AppData\Roaming\Adobe\Acrobat\Privileged\DC\JavaScripts

You need to adjust for userid. Note the "AppData" folder is a system directory and hidden. If you open Windows Explorer and enter the environmental symbol "%appdata%" in the address line you will be able to see the AppData/Roaming folder contents and you need to add the "Privileged\DC\JavaScripts" folders and place your code in the Adobe folder.

For Acrobat X you need to change the "DC" folder to "10.0"

JavaScript Changes for Acrobat X and Reader X, version 10.1.1

http://blogs.adobe.com/pdfdevjunkie/2011/09/javascript-changes-for-acrobat-x-and-reader-x-version-10-1-1.html

Bernd Alheit
Community Expert
Community Expert
August 27, 2017

What problem do have with the code?

suemo22Author
Known Participant
August 27, 2017

None of these are detecting when no more active docs are open.

try67
Community Expert
Community Expert
August 27, 2017

How are you executing the code, exactly?