Skip to content

TDML Examples

TaskManSync’s example catalog is copied from Settings > Other Settings > Export Examples…. It is a set of source files, not an installed gallery. To use a .tdml example, choose Import Decorations and add the file; its metadata header supplies the name and settings. Or paste its text into a TDML Decoration’s editor, which stores the text and reads only the header’s name when you save, then adapt it. See the Scripting Examples page for the catalog overview and the Scripted Decoration guide for importing Lua examples.

Literal characters

Backslash escapes the next character, including outside tags:

Write \{ready\} with \, \; \: and \\ characters.

It displays as:

Write {ready} with , ; : and \ characters.

Quotes are not a way to group TDML values; TDML has no quoted-string syntax. See the syntax rules.

Relative size and line offset

This two-line label is also in the example catalog as tdml/Two-Line Status.tdml:

--[[ Name: Two-Line Status ]]
{posv:anchor=center,offset=0}
{alignh:center}{szr:.55;wgt:700;fgc:#F8FAFC}BUILD 42{}
{szr:.3;osv:-3;fgc:#94A3B8}RUNNING{}{}

The sizes are factors of the realized Decoration height. osv:-3 moves the second logical line up by three logical pixels; it does not change its font size. Whole-presentation position and width remain separate from the text styles.

Dynamic text from Lua

This simplified clock (not the shipped file; the catalog’s scripted/Clock.lua also shows the date and opens a calendar Window) obtains local time through the Scripted Decoration time API, formats a Lua string, and combines it with TDML:

decoration.interval = 1000

local function renderClock()
    local now = time.localDateTime(time.now())
    local label = string.format("%02d:%02d", now.hour, now.minute)
    decoration.text =
        "{alignh:center}{szr:.5;wgt:700;fgc:#3388FF}" .. label .. "{}{}"
end

function onLoad()
    renderClock()
end

function onTick()
    renderClock()
end

Lua obtains and formats the time, then constructs the TDML source. TDML only styles the resulting label; it does not interpolate values or read task/window state. A Decoration is not automatically given the title or other fields of a nearby task. See Scripted Decorations for the supported API and Scripting Examples for the exported catalog.