Skip to content

Templates and variables

Template phrases reuse one body with values that change each time. Placeholders look like {{customer_name}}. Astramar resolves them before delivery and never leaves raw braces in the inserted text when a prompt or automatic source can fill them.

  1. Select a phrase and turn on Use as template in the Phrase editor.
  2. Add placeholders with {{name}} in the body. They appear as soft accent pills; the saved text stays plain {{name}} characters.
  3. While editing, type {{ (or a partial name) for autocomplete of phrase variables, shared variables, then built-ins. Tab or Return inserts the selected token.
  4. Review Template Variables. Unresolved variables show as inline alerts near the relevant control.

Each placeholder can use:

Source Behavior
Phrase Default A value stored on that phrase
Shared Variable One saved value reused across many phrases (Settings → Templates)
Built-In A value resolved at insert time

Prompt before insert (per variable):

  • On — Astramar prompts before paste/copy and prefills from the selected source.
  • Off — Astramar inserts the source value automatically when it can.

When the palette asks you to complete variables, use Tab / ⇧ Tab between fields. Return advances and delivers on the last field; ⌘ Return copies; ⇧ Return delivers and keeps the palette open.

Useful Free Beta built-ins include:

  • Date and time — {{date}}, {{time}}, {{datetime}}, {{iso_date}}, {{iso_datetime}}, {{year}}, {{tomorrow}}, {{yesterday}}
  • Offsets — e.g. {{date_plus_7d}}, {{iso_date_minus_1d}} (1–365 days)
  • Identity / device — {{uuid}}, {{username}}, {{short_username}}, {{hostname}}
  • Context — {{clipboard}}, {{clipboard_1}}{{clipboard_3}}, {{frontmost_app}}, {{selected_text}} (Accessibility; empty when unavailable)

Clipboard-derived values can contain sensitive data — prefer synthetic samples while testing.

  1. Open Settings → Templates.
  2. Add a shared variable with a name and value.
  3. On a template phrase, set a placeholder source to Shared Variable and pick it from the list.

Renaming or removing a referenced shared variable asks how to rewrite or leave unresolved {{name}} tokens. Differently cased tokens stay as written.

In Advanced, the inspector includes a local template sandbox for testing placeholder values and previewing the resolved phrase. Sandbox values do not rewrite the saved phrase body.