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

dataObjects - how does "name" get updated?

brian3017
Registered: Jan 14 2008
Posts: 18

Hello
I am trying to use the dataObjects 'function' to return the names of files in a package.

The 'function' works as per the JS API Reference, page 236 for a package comprising several pdf files. However, if I drag and drop new files into the package, the 'function' returns the correct names of the existing files, but returns "Untitled Object" for the newly added file.

The newly added file does have a file name and this appears correctly in the 'package contents' window, it also appears correct if I look to 'edit value' Name after right clicking on the newly added file.

Can any one tell me how to get the file name returned by this function for newly added files?

This is the code I'm using in the console:
var f = this.getField ("ContentsList")
var contents = ""
var d = this.dataObjects;
for (var i = 0; i < d.length; i++)
var contents = contents + d[i].name + "\n";
f.value = contents

My Product Information:
Acrobat Standard 8.1.2, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Are you setting the "disclosed" property for the added PDF file?

George Kaiser

brian3017
Registered: Jan 14 2008
Posts: 18
Thank you for the "disclosure" suggestion.
While I must admit thast I am yet to get on top of Acrobat security, I don't think disclosure is the answer - if I change the code ro look at 'description, instead of 'name', my code works okay with drag and drop files. Could there be another explanation?
regards Brian