Skip to content

Insert Into Note

This action inserts plain text or a Templater template at a specified line number into the note of the button.

interface InsertIntoNoteButtonAction {
type: 'insertIntoNote';
line: number | RelativeLineNumberExpression; // the line number to insert the text at
value: string; // the text to insert or the path to the Templater template
templater?: boolean; // if true, the value is a path to a Templater template
}

If templater is true, the value field is treated as a path to a Templater template. If templater is false or not specified, the value field is treated as plain text.

This button action supports relative line numbers.

This button inserts the text “Hello, world!” at line 3 of the note.

```meta-bind-button
style: primary
label: Insert Into Note
action:
type: insertIntoNote
line: 3
value: "Hello, world!"
templater: false
```

The below example adds the line “Hello” below the button using relative line numbers.

```meta-bind-button
label: Insert with relative line numbers
style: default
action:
type: insertIntoNote
line: selfEnd + 1
value: Hello
```