Macros

Macros allow you to chain multiple commands into a single executable action. This is powerful for automating repetitive tasks.

Creating a Macro

  1. Go to Settings > Commander > Macros.
  2. Click Add Macro.
  3. Give your macro a Name and select an Icon.
  4. Use the Add Command and Add Delay buttons to build your workflow.

Macro Actions

  • Command: Execute any Obsidian command.
  • Delay: Wait for a specified amount of time (in milliseconds). This is useful if a command needs time to complete (e.g., waiting for a view to open) before the next command runs.
  • Loop: Internal logic supports loops, allowing a command to be executed X times.

Auto-Run on Startup

You can check the Auto-Run on Startup box in the Macro Builder. This will execute the macro automatically every time Obsidian launches.

Usage

Once a macro is saved, it becomes a command itself. You can:

  1. Run it from the Command Palette.
  2. Add it to the Ribbon, Toolbar, or any other Commander location just like a regular command.

Example Workflow

"Morning Setup" Macro:

  1. Command: Daily notes: Open today's daily note
  2. Delay: 200ms
  3. Command: Graph view: Open graph view
  4. Command: Split right