Use the Script Editor
When writing a computation script, there are several tools you can use to make the process easier.
To use the script editor
- Edit the script or expression.
- At the Script or Expression field, complete any of the following tasks:
To | Do This |
Have HotDocs automatically complete keywords, component names, and Multiple Choice options as you type | Place your cursor in the Script field and press Ctrl+Spacebar. HotDocs displays a list of instruction and expression keywords, constant values (such as month abbreviations), and components. Type a portion of the keyword, component name, or Multiple Choice option for which you are searching. As you type, HotDocs filters the list to show only those keywords that contain the text you have typed. Once selected, press Enter to merge it into your script.
To keep seldom-used keywords out of the auto-complete list, click the |
Access just a list of components | Press the F5 key, select the component, and press Enter. |
Access just a list of keywords | Press Shift+F5, select the keyword, and press Enter. |
Display a syntactical hint of how an instruction or expression should be used | Place your cursor inside the keyword and press the F7 key. HotDocs displays a small ToolTip that shows the entire model as well as the type of value it produces, if it's an expression. |
Indent matching pairs of IF and REPEAT instructions based on the level of their insertion | Click the ![]() |
Undo (or cancel) an action you just performed | Click the ![]() |
Redo (or re-implement) an action you just performed | Click the ![]() |
Cut or copy and paste a selected portion of the script | Select the portion of the script you want to cut or copy, and then click the ![]() ![]() ![]() |
Find a specific string of text in the script | Click the ![]() ![]() To find only those instances of text that are complete words, select Find whole words only. To find only those instances that have the same capitalization as the text for which you are searching, select Match case. |
Find a specific string of text in the script and replace it with another string of text | Click the ![]() To find and replace script text in a specific block of script, select the block of script first and then click the |
Move your cursor to a specific location in the script | Click the ![]() |
Indent or outdent a block of the script | Select the portion of the script you want to indent or outdent and click the ![]() ![]() |
Cause HotDocs to ignore a section of the script when it processes it, or insert a comment in the script | Highlight the block of the script you want to comment and click the ![]() ![]() |
Match an IF or REPEAT instruction with its END IF or END REPEAT instruction (or vice versa) | Place your cursor inside the instruction, right-click, and select Match IF/REPEAT from the shortcut menu. (You can also press Ctrl+M.) |
Highlight an entire IF or REPEAT instruction block (meaning everything between a beginning and ending IF/REPEAT instruction) | Place your cursor inside the instruction, right-click, and select Select IF/REPEAT from the shortcut menu. (You can also press Ctrl+Shift+M.) |
View helpful information while using the script editor, including accessing help topics for the different instructions and expressions you can use in your script | Click the ![]() |
Customize the way the script editor works | Click the ![]() |
Insert line breaks and tab characters in a script | See Use Line Breaks, Paragraph Ends, and Tabs in Computation Scripts. |
Assign formatting characteristics to literal text strings in a script | Insert the corresponding dot code. See one of the following topics for details: |
To access the script editor toolbar using the keyboard, press F10.
To access help for each instruction or expression, first select the model in one of the lists and then press Ctrl+F1.
For an explanation of the HotDocs scripting language, see Understand the HotDocs Scripting Language. For details on creating a Computation variable, see Customize a Computation Variable. For a list of instruction and expression models, see Introduction: Instruction and Expression Models.