Skip to content

[BUG] "Pick a day" for macro ignores specified DATE variable for nested Template #2265

Description

@aarontcannon

Describe the bug
When running a macro with "(Pick a day)", templates that have DATE set to a variable use the "(Pick a day)" result rather than the variable result.

To Reproduce
Steps to reproduce the behavior in Obsidian:

  1. Set a global variable (or a custom script that sets a local variable) called testDate set to some date different than today.
  2. Create a macro with a name like test
  3. Set Add to command palette and Add to command palette (Pick a day)
  4. Add the above custom script to set the local "testDate" variable
  5. Add a template to the macro that uses {{DATE}} for the filename (and some blank note for the template)
  6. Run the macro normally - the note should be created with the name of today's date
  7. Run the macro with (Pick a day) and select a date other than what the script/global variable is set to - the note gets created with the name of the date that was picked rather than the value of the variable.

Expected behavior
When a DATE is set to a variable, it should always use that variable rather than getting overridden by the result of "(Pick a day)". For the other options (yesterday, last week, custom) I'm not sure what the obvious expected behavior would be when using "(Pick a day)". But for variables I think it makes sense to not have "(Pick a day)" override it, since rarely would the variable provided be directly based on DATE.
Obsidian Debug Info (required for bug reports)

SYSTEM INFO:
	Obsidian version: 1.14.4
	Installer version: 1.14.4
	Operating system: Windows 11 Pro 10.0.26300
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 1
	Plugins enabled: 1
		1: QuickAdd v2.32.1

RECOMMENDATIONS:
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Activity

  1. chhoumann commented on Oct 30, 2026

    @chhoumann
    Owner

    Hey @aarontcannon! Thanks for the report, and for following up on #2242. I could reproduce it, and it's fixed in #2266, which will ship in the next QuickAdd release.

    "(pick a day)" set the picked day for every choice inside the macro, so your Template's A variable… setting never got read. A macro's own Which day did the same thing, even without "(pick a day)".

    Now a choice inside a macro with Which day set to A variable… always uses its variable. That holds when you run the macro with "(pick a day)", and when the macro has its own Which day. You're right that the variable is rarely based on {{DATE}}, so the picked day shouldn't replace it.

    Today, Ask each time, Yesterday, Last week, and Custom still take the macro's day, like before. With "(pick a day)", that's the day you picked. I kept it that way so the days don't stack: a macro set to Last week, with its templates also set to Last week, should still write last week, not two weeks ago.

    I tested it in Obsidian with your setup: a script that sets testDate, a Template that uses testDate for its day with {{DATE}} as the file name, and the macro's "(pick a day)" command. Before the fix, the note was named after the picked day. After the fix, it's named after testDate, and a second Template on Today still gets the picked day.

    Global variables are different. A variable… only reads variables set during the run, like the ones a script or a {{VDATE}} prompt sets. It can't read global variables, because those are text QuickAdd fills in where you write {{GLOBAL_VAR:name}}. If you point Which day at a global variable, the run stops with Date origin variable "testDate" is not set. Set it from a script step instead:

    module.exports = async (params) => {
    	params.variables.testDate = "2026-01-02";
    };

    Let me know if anything still acts up after you update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions