Add timed pauses to Snippet expansion with the Delay macro
Overview
When a Snippet moves through a form faster than the website or app can respond, the next keystroke may land in the wrong field. The Delay macro adds a fixed pause to a Snippet. You choose the length of the pause in milliseconds, and TextExpander waits that long before expanding the rest of the Snippet, giving dropdowns, search results, and other interface elements time to load before expansion continues.
For example:
delay(300)pauses for 300 milliseconds.delay(500)pauses for half a second.delay(1000)pauses for one second.
You can place more than one Delay macro in a Snippet and use a different duration for each pause.
When to use a delay
Add a delay when a Snippet uses keyboard actions to move through an app and the app needs more time before it can accept the next action. Common examples include:
- Waiting for a dropdown menu to open before sending an arrow key or Enter
- Pausing after moving into a search or lookup field so results can appear
- Allowing an address or other form field to validate before moving to the next field
- Giving a web app time to render the next part of a form
- Slowing a sequence of Tab, Enter, or arrow-key actions so each action reaches the intended field
A delay can be especially useful in heavily scripted web apps, CRM systems, HR platforms, and custom internal tools.
How to add a Delay macro to a Snippet
- Open the Snippet you want to edit.
- Place the cursor where the pause should happen.
- In the editing bar, click the keyboard icon to open the Keyboard macros menu.
- Select Delay.
- Enter the number of milliseconds TextExpander should wait.
- Save the Snippet.
When you expand the Snippet, TextExpander pauses when it reaches the Delay macro and then continues automatically.
Example: Wait for a dropdown to open
Suppose a Snippet enters an address, moves to a dropdown, and selects the second result. Without a pause, the arrow and Enter actions may happen before the dropdown appears.
[Insert address]
[Tab]
delay(500)
[Down]
[Down]
[Enter]
Here, TextExpander waits 500 milliseconds after moving to the dropdown. The pause gives the dropdown time to open before TextExpander sends the arrow-key actions.
Example: Move through a multi-step form
A Snippet can include multiple delays when different parts of a form need time to respond:
[Insert patient name]
[Tab]
[Tab]
delay(500)
[Insert address]
[Enter]
delay(300)
[Down]
[Down]
[Enter]
The first delay allows the address field to become ready. The second gives the dropdown time to display its options.
Choosing an appropriate delay
Start with a short delay, such as 300–500 milliseconds, and test the Snippet in the app where you plan to use it. If the next action still happens too soon, increase the delay in small increments.
Keep these tips in mind:
- Use the shortest reliable delay. Longer pauses make the Snippet feel slower than necessary. Start with 300–500 milliseconds, test the workflow, and adjust until it works consistently.
- Test in the target app. The same workflow may need different timing in different websites or apps. Test important workflows on each platform and in each app where the Snippet will be used. Create app-specific versions of the Snippet or adjust the delays for each workflow.
- Account for variable loading times. Network speed and app performance can affect how long a field or menu takes to appear.
- Place the delay immediately before the action that needs to wait. This makes the Snippet easier to understand and edit later.
- Add multiple delays when needed. One pause does not have to control the timing of the entire Snippet.
Additional details
- The Delay macro waits for a fixed amount of time. It pauses for the duration you set and does not detect when a page, field, or menu has finished loading.