ASSEMBLE "FILENAME"

Placeholder Replace With
FILENAME The name of another HotDocs templateA word processor or form document that has been converted to HotDocs format so that it can be automated. When in template format, changeable text in the template can be replaced with variables. Other instructions can be added as well, such as instructions that create lists, condition text, and insert other templates.

Complete instructions on using the ASSEMBLE instruction can be found in the topic, Start a New Assembly From a Template.

You can use the ASSEMBLE instruction to add templates to the assembly queueA dialog box that shows a list of assemblies—pending, current, and completed. Users can open the Assembly Queue by clicking Assembly Queue in the assembly window toolbar. It is most useful when users have selected multiple templates for assembly.. Unlike the INSERT instruction, an ASSEMBLE instruction waits until the current documentThe file that is created after a template has been assembled. is assembled before starting the next assembly session.

For example, you may or may not need to include a cover letter with the document you are assembling. If you do, the following scriptOne or more instructions and/or expressions that generate a value or execute some kind of procedure. adds the template, Cover Letter, to the assembly queue.

«IF Cover Letter Required»

«ASSEMBLE "Cover Letter.docx"»

«END IF»

In this script, if the userThe customer, client, or person who assembles documents from templates. (See also template developer.) opts to assemble a cover letter, then the ASSEMBLE instruction is processed and HotDocs assembles the cover letter template after the main document is assembled.

Understand How Templates Are Added to the Assembly Queue

To achieve the best results when using the ASSEMBLE instruction, you should understand how HotDocs adds the templates it finds in ASSEMBLE instructions to the assembly queue—particularly if your template uses a custom interview. There are two different scripts that HotDocs processes during an assembly:

  • The template script is the body of the template where HotDocs merges the answers to produce the assembled document.
  • The interviewA series of dialogs, each containing one or more questions which HotDocs generates from the variables you add to your template. The template's user must answer the questions in the interview before HotDocs can assemble a custom document. You can view the interview by clicking the Interview tab of the assembly window. The left pane of the assembly window displays an outline of the interview. As the user answers questions, the outline tracks the user's progress through the interview. script is the set of instructions that determine what dialogs to include in the interview. If your template uses a custom interview, this is your custom interview computation (e.g., INTERVIEW). Otherwise, the interview script is the same as the template script for a default interview.

Each time HotDocs processes one of these scripts, it first removes from the Assembly Queue any templates that were added by ASSEMBLE instructions in the current template. Then, as HotDocs encounters each ASSEMBLE instruction, it adds that template to the assembly queue. Thus, if you have an ASSEMBLE instruction in your custom interview script, the template in that instruction will be added to the assembly queue whenever HotDocs processes your interview script.

This behavior can cause a problem if the ASSEMBLE instructions in your interview script do not match the instructions in the template script. For example, if HotDocs adds templates to the assembly queue while processing the interview script, those templates could be removed when HotDocs subsequently processes the template script. Likewise, if your template script adds templates to the assembly queue, they could be removed when the interview script is processed.

To ensure that templates are added to, and remain in, the assembly queue, you should include identical ASSEMBLE instructions in both your interview and template scripts. This way, no matter which script HotDocs processes last, it will put the desired templates in the assembly queue. (As noted above, both scripts are identical if you use a default interview, so this information is only important when you use a custom interview in your template.)

You can add command-line options to an ASSEMBLE instruction (for example, ASSEMBLE "subpoena.docx /pr"). If the command-line optionAn instruction used to control the operation of HotDocs. These instructions, or commands, are added to any command line that causes HotDocs to run. They can alter the operation of specific templates, or they can affect the overall operation of HotDocs. includes a file path and name, enclose the path and name in double quotation marks (for example, ASSEMBLE "subpoena.docx /sa /af=""L Chang.anxFile name extension that designates a HotDocs answer file."""). (Four command line options were designed specifically for use with ASSEMBLE instructions. They are: Suggest Save, Suggest Save New, Save Answers, and Save Answers Prompt. They control the saving of answers after each ASSEMBLE instruction is processed.)