QuickAdd Macro - Showing a list of files to use in macros
Metadata
QuickAdd Macro: Showing a list of files to Capture automatically

First, create a snippet in the snippets folder named list_files_in_folder.js. This snippet is only needed to be created once, as it is configurable and will be the base for all the other steps.

module.exports = {
    entry: async (QuickAdd, settings) => {
        const folderName = settings.folderName;
        const files = await QuickAdd.app.vault.getFiles();
        const { quickAddApi: { suggester } } = QuickAdd;
        const filteredFiles = files.filter(file => file.path.includes(folderName));
        const pickedFile = await suggester(
            (file) => file.basename,
            filteredFiles
        );
        QuickAdd.variables.pickedFileName = pickedFile.basename;
        QuickAdd.variables.pickedFilePath = pickedFile.path;
    },
    settings: {
        name: "File picker",
        author: "Danielo Rodriguez",
        options: {
            folderName: {
                type: "text",
                defaultValue: "",
                placeholder: "Folder name",
            },
        }
    },
};

Then you need to create a new macro and a new macro choice for each use case. This is a bit tedious and I don't know why this indirection is needed.
In this example, I will be creating one macro choice for visiting restaurants (called Macro - Visit restaurant) and another one for interacting with people/taking notes about someone, called Macro - Person note. As I mentioned, we also need a new macro for each of those so we can properly configure the script.
In the following screenshots, you will see the visit restaurant already created and I'm going to create the person note one:
Pasted image 20230803115022.png
Pasted image 20230803115035.png
Pasted image 20230803115050.png
Pasted image 20230803115104.png
Pasted image 20230803115114.png
Pasted image 20230803115711.png
Pasted image 20230803115715.png
Now let's add the macro choice that makes use of this macro:
Pasted image 20230803114158.png
Click Add choice, then click in the cog icon and select the new macro list-files-person
Pasted image 20230803115137.png