Opens in a new tab

Help · Snippet content

Macro Reference

Every % code Shorthand understands, grouped by what it does. Codes are typed straight into a snippet’s text.

You don’t have to remember these. In the snippet editor, click the Insert menu (above the text, on the right) and pick a code. Its submenus are Date, Time, Date/Time Math, Fill-ins, Snippet, Key, Clipboard, Calculation, Condition, AI ✨, Cursor, Delimiter, and Percent Sign (%).

Fill-ins

Fill-ins open a small window where you type or choose values before the snippet is inserted. See Fill-ins for a walkthrough.

Code

What it does

%filltext:name=Name:default=Sam:width=20%

A single-line text field. All settings are optional.

%fillarea:name=Notes:default=:width=30:height=5%

A multi-line text box. width and height are in characters and lines.

%fillpopup:name=Size:Small:default=Medium:Large%

A pop-up menu. Options are separated by colons; default= marks the option chosen at first. Without it, the first option is chosen.

%fillpart:name=PS:default=yes%…%fillpartend%

An optional section with a checkbox. The text between the two codes is included only when the box is checked. default=yes (or true or 1) checks it at first.

%filltop%

Opens the fill-in window at the top center of the screen instead of near the text cursor.

Settings inside a fill-in: name=, default=, width= (not for pop-ups) and height= (multi-line boxes only). Fields with the same name share one value, so you type it once.

Date and time

Names of months, weekdays, and AM/PM follow your Mac’s language and region settings. Examples are for Monday, January 5, 2026, at 2:05:07 PM in New York.

Code

Shows

Example

%Y

Year, four digits

2026

%y

Year, two digits

26

%B

Month name

January

%b

Short month name

Jan

%m

Month number, two digits

01

%1m

Month number, no leading zero

1

%A

Weekday name

Monday

%a

Short weekday name

Mon

%d

Day of the month, two digits

05

%e

Day of the month, no leading zero

5

%j

Day of the year, three digits

005

%H

Hour, 24-hour clock, two digits

14

%1H

Hour, 24-hour clock, no leading zero

14

%I

Hour, 12-hour clock, two digits

02

%1I

Hour, 12-hour clock, no leading zero

2

%M

Minute, two digits

05

%1M

Minute, no leading zero

5

%S

Second, two digits

07

%1S

Second, no leading zero

7

%p

AM or PM

PM

%z

Offset from GMT

-0500

%Z

Time zone abbreviation

EST

%date:yyyy-MM-dd%

Any custom format, using Unicode date patterns

2026-01-05

Capital and small letters mean different things: %1m is the month, %1M is the minute. %d pads with a zero, %e doesn’t.

Date and time math

Put %@, a plus or minus sign, a number, and a unit before your date codes. Every date code after it uses the shifted date.

Code

Shifts the date by

%@+1Y

Years

%@+1M

Months (capital M)

%@+15D

Days

%@-1D

Days back (yesterday)

%@+2h

Hours

%@+30m

Minutes (small m)

%@+45s

Seconds

More examples on Dates & Times.

Clipboard and other snippets

Code

What it does

%clipboard

Inserts the text currently on the clipboard.

%snippet:sig%

Inserts another snippet by its abbreviation (here sig). Snippets can include snippets up to 8 levels deep. If no snippet has that abbreviation, nothing is inserted.

Calculations, conditions, and AI

Code

What it does

%calc:{qty}*{price}:2%

Works out a sum. :2 at the end means two decimal places. See Calculations & Conditions.

%if:{field}%…%else%…%endif%

Includes text only when a condition is true. %else% is optional.

%ai:Write a polite reply to: {clipboard}%

AI writes this part when the snippet expands. Needs an AI provider (Setting Up AI).

{name} means “the value of the fill-in called name,” and {clipboard} means the clipboard text. These references work only inside %calc, %if, and %ai, so curly braces in ordinary text (CSS, code) are left alone.

Keys

%key:name% presses a key while the snippet is being typed, for example to move between fields in a web form.

Code

Presses

%key:tab%

Tab

%key:return%

Return

%key:enter%

Enter

%key:esc% or %key:escape%

Escape

%key:space%

Space

%key:backspace%

Delete (backwards)

%key:delete% or %key:forwarddelete%

Forward delete

%key:up% / %key:uparrow%

Up arrow

%key:down% / %key:downarrow%

Down arrow

%key:left% / %key:leftarrow%

Left arrow

%key:right% / %key:rightarrow%

Right arrow

%key:home%, %key:end%

Home, End

%key:pageup%, %key:pagedown%

Page Up, Page Down

Key names are not case-sensitive. An unknown key name is left in the text as typed.

Cursor and selection

Code

What it does

%|

Puts the text cursor here after expanding.

%\

Used after %|: selects the text between the two codes.

%<

Moves the cursor one place left after expanding.

%>

Moves the cursor one place right.

%^

Moves the cursor up one line.

%v

Moves the cursor down one line.

Example: <b>%|</b> types <b></b> and leaves the cursor between the tags.

Delimiter and percent sign

Code

What it does

%+

Keep the delimiter (the space, Return, etc. you typed after the abbreviation), whatever your setting.

%-

Drop the delimiter, whatever your setting.

%%

A literal percent sign.

See Delimiters for what a delimiter is.

Rules worth knowing

  • A code runs to the next %. So a prompt, condition, field name, or default can’t contain a % sign, and fill-in settings can’t contain a colon.

  • Write %% for a real percent sign, e.g. Save 20%% today.

  • Anything that isn’t a known code is left exactly as written, so 100% sure still types “100% sure”.

  • Script snippets (AppleScript, shell, JavaScript) don’t use these codes; their output is inserted as-is. See Script Snippets.

Related: Fill-ins · Dates & Times · Calculations & Conditions · AI Features