ATC: ATTACH DUPLICATE [full filename] | $FileKey COMMENT text

ATC: ATTACH DUPLICATE  PROJECT Project FOLDER [full path] NAME [name.ext] COMMENT text

This command attaches a clone of a file already in the Spitfire Catalog to a document being created or modified by the workflow script. [See ATC: ATTACH FILE if the intention is to attach a link to an existing file instead.]

  • [full filename] must begin with an open square bracket.  This legacy version of the command is seldom used because it does not scale well.  
  • $FileKey can be any variable name.  The variable should contain a file key, likely returned from a qAlias (see example)
  • PROJECT, when specified, must be the first option and must be followed by Project (a variable or project ID).
  • FOLDER must immediately follow PROJECT and must be followed [full path] which must be in brackets and begin with a slash (/).  You can use a $variable.
  • NAME must immediately follow FOLDER and  [name.ext] must be in brackets.  You can use a $variable.  Examples include sample.docx and insuranceCert.pdf.
  • COMMENT text is optional. The text will appear as a note on the Attachment tab.

Examples:

ATC: ATTACH DUPLICATE [/Compliance Forms/W9.pdf]

The above example means “create a cloned copy of the W9.pdf file that is found on the Compliance Forms folder in the Catalog and attach it to the document.”

ATC: QUERY qRelevantFiles
ATC: FOREACH qRelevantFiles BY ReferenceDate
   ATC: SET $FileKey = @.FileKey
   ATC: ATTACH DUPLICATE $FileKey COMMENT relevant file
ATC: ENDLOOP

The above example means “run a query that returns a list of relevant files and for each file returned, set the $FileKey variable to the file key and attach a cloned copy of the file to the document.”  In this simplified example, there is no meaning to what represents a relevant file – it might involve file type, date range and other criteria.  The query should NOT return files already attached to the document.


Last updated: August 6, 2025 at 12:02 pm  

Related Post

ATC: ENDIFATC: ENDIF

ATC: ENDIF This command marks the end of an IF block that starts with ATC: IF. Examples ATC: IF SourceDocNo = NULL ATC: SET SourceDocNo = DocNo ATC: ENDIF The

ATC: ADD COMMENTATC: ADD COMMENT

ATC: ADD COMMENT description This command adds a comment/remark to the current target document. description is required. The freeform description can be any text and can include spaces Note: to format