quickadd icon indicating copy to clipboard operation
quickadd copied to clipboard

QuickAdd note to currently active path

Open feedhopper opened this issue 2 years ago • 2 comments

Describe the solution you'd like It would be great if there was a variable such als {{VALUE}} only for the path currently open by the active note.

Even better would be something like {{PATH}} presenting users with a "current path" preselection they could override by entering any specific path

Ideally, this process of filling out the path would work like the rest of Obsidian in terms of autocomplete. So,

folder/folder/folder/folder/goal

woudl automatically be found by typing

goal

PS

LOVING and USING the plugin A LOT! THANK YOU :)

feedhopper avatar Nov 05 '22 16:11 feedhopper

I second this. It would be great to have a variable for obtaining the path of the file from which a QuickAdd template is activated so that one can create new notes inside the same folder. I'm right now trying to find a workaround for this.

Another, related matter, is that in a capture template, if no folder is specified then the file is just created in the root, irrespective of how Obsidian is configured. Under files & links in the general Obsidian settings one can specify a folder into which new files go, when they are created. One of the options are "same folder as current file". I think it would be quite nice if QuickAdd would honour this setting and then specifying the additional variable suggested above in a template could be the means to override the general setting.

psigurdsson avatar May 29 '23 20:05 psigurdsson

create a script called activeFile.js with the code bellow

module.exports = async function add(params, settings) {
    let activeFile = app.workspace.getActiveFile();
    let activeFilePath = activeFile?.path;

    settings.variables = { activeFilePath}
}

then create a macro

add the script add a capture, and type in {{value:activeFilePath}} in the file name input

RomanMunar avatar Dec 24 '23 06:12 RomanMunar