Skip to content

farux/obsidian-auto-note-mover

Repository files navigation

Auto Note Mover

Auto Note Mover will automatically move the active notes to their respective folders according to the rules.

How it works

Register the tag or title of the note you want to move to the rule.

When the active note matches the rule, Auto Note Mover will move the note to the destination folder.

If you create a new note from a link in an existing note or from another plugin, Auto Note Mover will move those notes to the folder you want, so you don't have to worry about where or how to create the note.

If the rule is matched but the destination folder is not found, or if the destination folder has a note with the same name, a warning will be displayed and the move will be aborted.

Triggers

There are two types of triggers for Auto Note Mover.

Automatic

Triggered when you create, edit, or rename a note, and moves the note if it matches the rules.

You can also activate the trigger with a command.

Manual

Will not automatically move notes.

You can trigger by command.

Rules

  1. Set the destination folder.
  2. Set a tag or title that matches the note you want to move. You can set either the tag or the title.
  3. The rules are checked in order from the top. The notes will be moved to the folder with the first matching rule.

Tag: Be sure to add a # at the beginning.

Title: Tested by JavaScript regular expressions.

Notice

  1. Attached files will not be moved, but they will still appear in the note.
  2. Auto Note Mover will not move notes that have "AutoNoteMover: disable" in the frontmatter.

Example of use

Tag

Food0

Food2

Nested Tag

nest0

nest1

Daily Notes

day0

day1

Task Notes

task0

task1

Star Notes

sta0

sta1

How to Notes

how0

how1

Command

comm

Disable Auto Note Mover in front matter.

fm0

Troubleshooting

1. Notes do not move.

Make sure that the rules are correct, that no excluded folders are set, and that they are not disabled in the frontmatter. Another possibility is that if the vault is monitored by a real-time sync software like Dropbox, if the editing overlaps with the timing of the sync, the sync software might lock the note and prevent it from being moved.

2. Duplicate notes

Check your sync software.

Duplicate notes due to iCloud glitches have been reported. #19

Attribution

suggest.ts and file-suggest.ts are copyrighted works of Liam Cain (https://github.com/liamcain) obsidian-periodic-notes (https://github.com/liamcain/obsidian-periodic-notes).

popper.js https://popper.js.org/

Special Thanks

Thanks to @pjeby for his help in creating this plugin.