@AttachmentNames (JavaScript™)
Returns the names of the files attached to the current document.
Defined in
@Functions (JavaScript)Syntax
@AttachmentNames() : any
Return value | Description |
---|---|
any |
An array of strings containing the file names, or an empty string if the current document has no attachments. |
Examples
This example is the value for a computed field. It returns the number of attachments in the current document, plus the names, lengths, and modification times of the attachments.var s = "Attachments (" + @Attachments() + "):\n";
for(var i = 0; i < @Attachments(); i++) {
s = s +
@AttachmentNames()[i] + " (" +
@AttachmentLengths()[i] + " bytes) " +
@AttachmentModifiedTimes()[i] + "\n";
}
return s;