These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to manipulate a specific PDF document while several are open

oald
Registered: Oct 12 2011
Posts: 17
Answered

If I open "Test1.pdf", "Test2.pdf", "Test3.pdf", "Test4.pdf" at the same time, and I want to change the PDF Document Metadata (e.g. Author) of "Test4.pdf", how can I define "Test4.pdf" as a named Doc object? I try the codes below, but fail, with error message saying "Test4 is not defined 1:Console:Exec"
  
var test4 = Test4.pdf;
test4.info.author = "Acrobat 8.1.6";
  
Your suggestion and guidance are really appreciated!
   

My Product Information:
Acrobat Pro 8.1.6, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
Use the app.activeDocs array to find the document you want to modify.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

oald
Registered: Oct 12 2011
Posts: 17
Hi try67,

Thanks for your answer, I have corrected my as following and it works:

var openedDocs = app.activeDocs;
openedDocs[3].info.author = "Acrobat 8.1.6";
try67
Expert
Registered: Oct 30 2008
Posts: 2398
I think it is a better idea to iterate over the activeDocs array, checking the files' paths to find the correct file, and only then edit it.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com