Template Variables Overview
Template variables are what transform Snipset from a simple text expander into a powerful automation tool. By embedding special codes inside your snippet content, you can dynamically insert data, trigger actions, or fetch information exactly at the moment the snippet expands.
What Are Template Variables?
Section titled “What Are Template Variables?”When a snippet expands, Snipset scans the content for variables and replaces each one with its real value at that exact moment.
Snippet Content:Dear #{clipboard},
If your clipboard contains “John”:Dear John,
The #{ } Syntax Rule
Section titled “The #{ } Syntax Rule”Every variable in Snipset must follow a strict formatting rule:
It must start with a hash
#followed immediately by an opening curly brace{.It must end with a closing curly brace
}.Variables that take arguments use a colon
:to separate the name from the argument (e.g.,#{date:yyyy-MM-dd}).Variables are case-sensitive:
#{date}is correct.#{Date}will not work.
Common Mistake: Do NOT use ${…} or
{{…}}. These are used in other programming languages, but
Snipset specifically requires #{…}.
Variable Categories
Section titled “Variable Categories”Variables are grouped by function. Click on a category to see its detailed documentation:
| Category | What it does |
|---|---|
| Date & Time | Insert the current date or time with custom formatting and offset math. |
| Text & Clipboard | Paste clipboard contents, capture selected text, and precisely position the cursor. |
| Scripting | Run Rhai scripts for programmatic automation. |
| Interactive | Pick random values. |
Combining Variables
Section titled “Combining Variables”You can mix and match variables freely within a single snippet.
Snippet: [#{date:dd/MM/yyyy}] Re: #{clipboard}#{cursor}
On Expansion:[22/04/2026] Re: Project Alpha proposal| (cursor is placed at the end)
Variable Evaluation Order
Section titled “Variable Evaluation Order”Variables are evaluated left to right, top to bottom.