This setup will let you choose a file from a folder you specify, then open up the Tasks modal to input your task parameters.

  1. Open a text editor and paste the following in there (removing the backticks):
module.exports = async function listFiles(params) { 
    const fileType = { 
        folder: "",
        folderExclude: "",
        fileExclude: ""
    const files =
        .filter(file => file.path.match(fileType.folder))
        .filter(file => {
            if (fileType.folderExclude) { return !file.path.match(fileType.folderExclude) }
            else { return file }
        .filter(file => {
            if (fileType.fileExclude) { return !file.path.match(fileType.fileExclude) }
            else { return file }
    const notesDisplay = await params.quickAddApi.suggester(
        (files) => files.basename, files
    if (!notesDisplay) {
        new Notice("No file selected.");
        throw new Error("No file selected.");
    params.variables = {
        note: notesDisplay.path
  1. Set the variables folder, folderExclude and fileExclude to whatever you need, where:
    • folder is the folder you want to include
    • folderExclude is a folder you want to exclude
    • fileExclude could be a file name pattern you want to exclude
  2. Save the file in your vault as capture-task.js, making sure that the file extension is js (and not .js.txt)!
  3. Open the QuickAdd settings and add a macro choice via the “Add choice” button.
  4. Open the configuration screen of the macro choice, then first click on the plus button and then the cog symbol that remains.
  5. Select capture-task in the “User Scripts” dropdown & add it.
  6. Add your capture from the “Choices” dropdown.
  7. Go back to the main QuickAdd settings and configure your Capture so that the file name is set to {{VALUE:note}}, leave the rest.