@Attachments (JavaScript™)
Returns the number of files attached to the current document.
Defined in
@Functions (JavaScript)Syntax
@Attachments() : int
Return value | Description |
---|---|
int |
The number of attached files. |
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;