mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 02:52:27 +08:00
6.0 KiB
Vendored
6.0 KiB
Vendored
Bulk Actions

The Bulk Actions dialog makes it easy to apply changes to multiple notes at once, ranging from simple actions such as adding or removing a label to being executing custom scripts.
Interaction
- The first step is to select the notes in the Note Tree. It's possible to apply bulk actions to:
- A single note (and potentially its child notes) simply by clicking on it (with a left click or a right click).
- Multiple notes. See Multiple selection on how to do so.
- Right click in the Note Tree and select Advanced → Apply bulk actions.
- By default, only the selected notes will be affected. To also include all the descendants of the notes, check Include descendants of the selected notes. The number of affected notes at the top of the dialog will update to reflect the change.
- Click on which action to apply from the Available actions section. A detailed description of each is available in the next section.
- For each action selected, the Chosen actions section will update to reveal the entry. Each action will have its own configuration.
- To remove an action, simply press the X button to the right of it.
- It is possible to apply multiple actions of the same type, such as adding multiple types.
- When all the actions are defined, press Execute bulk actions to trigger all of them at once.
- For convenience, the last bulk action configuration is saved for further use and will be restored when entering the dialog again.
Actions
Labels
These actions operate the Labels of a note:
- Add label
- For each note, if it doesn't already have a label of the given name, it will create it. Keep the New value field empty to create a label without a value, or complete it to assign a value.
- If a note already has this label, its value will be updated.
- Update label value
- For each note, if it has a label of the given name, it will change its value to the specified one. Leave New value field empty to create a label without a value.
- Notes without the label will not be affected.
- Rename label
- For each note, if it has a label of the given name, it will be renamed/replaced with a label of the new name. The value of the label (if present) will be kept intact.
- Notes without the label will not be affected.
- Delete label
- For each note, if it has a label of a given name, it will be deleted (regardless of whether it has a value or not).
- Notes without the label will not be affected.
Relations
These actions operate the Relations of a note:
- Add relation
- For each note, it will create a relation pointing to the given note.
- Notes without this relation will not be affected.
- Update relation target
- For each note, it will modify a relation to point to the newly given note.
- Notes without this relation will not be affected.
- Rename relation
- For each note, if it has a relation of the given name, it will be renamed/replaced with a relation of the new name. The target note of the relation will be kept intact.
- Notes without this relation will not be affected.
- Delete relation
- For each note, if it has a relation of the given name, it will be deleted.
- Notes without this relation will not be affected.
Notes
- Rename note
- For each note, it will change the title of the note to the given one.
- As a more advanced use case, the note can be a “template string” which allows for dynamic values with access to the note information via FNote, for example:
NEW: ${note.title}
will prefix all notes withNEW:
.${note.dateCreatedObj.format('MM-DD:')}: ${note.title}
will prefix the note titles with each note's creation date (in month-day format).
- Move note
- For each note, it will be moved to the specified parent note.
- As an alternative for less complex situations, the notes can be moved directly from within the Note Tree via cut → paste or via the contextual menu.
- Delete note
- For each note, it will be deleted.
- As an alternative for less complex situations, the notes can be removed directly from within the Note Tree by selecting them and pressing Delete.
- Delete note revisions
- This will delete all the Note Revisions of the notes.
Others
- Execute script
- For more complex scenarios, it is possible to type in a JavaScript expression in order to apply the necessary changes.
- Examples:
-
To apply a suffix (
- suffix
in this example), to the note title:note.title = note.title + " - suffix";
-
To alter attributes of a note based on another attribute, such as setting the
#shareAlias
label to the title of the note:note.setLabel("shareAlias", note.title)
-