Expand my Community achievements bar.

SOLVED

How do I determine the name of a file from a watched folder

Avatar

Level 3

I would like to generate a log to track the names and outcomes of files processed from a watched folder.  I don't see a way to access the name of the file from within the process.  I have a variable "inPDF" which is data type "document" and "outResult" which is type "xml" but I don't see a way to access the file name (or path) of the "inPDF" "document" object.  Is there a way to access the file name and path?

1 Accepted Solution

Avatar

Correct answer by
Level 8

The document's name and path can be accessed using the document's attributes.  If you are using a process, you can use a SetValue operation and get the attributes using the getDocAttribute function (under Functions/Document Object Functions).  There are three attributes that are of interest:

basename - gives you just the file name

file - gives the filename and the path (usually from the stage directory)

wsfilename - the filename for workspace, in most cases the same as file.

attributes.png

View solution in original post

4 Replies

Avatar

Level 10

You can use xPath and use the function getDocAttribute (/process_data/@inDoc,"filename") to get the attribute into a string.

Jasmin

Avatar

Correct answer by
Level 8

The document's name and path can be accessed using the document's attributes.  If you are using a process, you can use a SetValue operation and get the attributes using the getDocAttribute function (under Functions/Document Object Functions).  There are three attributes that are of interest:

basename - gives you just the file name

file - gives the filename and the path (usually from the stage directory)

wsfilename - the filename for workspace, in most cases the same as file.

attributes.png

Avatar

Level 3

Thank you, this sounds promising.

Where can I find documentation describing the attributes that can be retrieved using the getDocumentAttribute function?  Also, where can I find a complete reference on the Document object?

Best Regards,

Noam

Avatar

Level 8

There isn't really a set list of attributes because the document object allows anyone to add thier own (setAttribute).  You can get a list of all the ones set on a existing document using the listAttributes function.   Here is some useful documentation:

The official documentation has info on the document functions:

http://help.adobe.com/en_US/LiveCycle/9.5/WorkbenchHelp/WS92d06802c76abadb-43a6230012826bec632-7eff....

The attributes used by attachments and notes (Workspace  type attributes):

http://help.adobe.com/en_US/LiveCycle/9.5/WorkbenchHelp/WS92d06802c76abadb-1cc35bda128261a20dd-7e57....

The JavaDocs for the 9.0 (LiveCycle ES2) document object:

http://help.adobe.com/en_US/livecycle/9.0/programLC/javadoc/com/adobe/idp/Document.html