Skip to content

Help logging selected file name to the DNP #507

Answered by jenningsb2
jenningsb2 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for your help @nicobako

After a lot of trial and error, I got the outcome I was hoping for!

module.exports = async function listFiles(params) {
    const fileType = { 
        folder: "Meetings/Recurring",
    }
    // Get all files
    const allFiles = params.app.vault.getMarkdownFiles();

    // Filter files that start with 'Meetings/Recurring/'
    const files = allFiles.filter(file => file.path.startsWith(fileType.folder));

    // Use the suggester to select a file from the filteredFiles
    const notesDisplay = await params.quickAddApi.suggester(
        files.map(file => file.basename),
        files
    );

    // Assign the path of the selected file to a variable
    params.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@nicobako
Comment options

@nicobako
Comment options

@nicobako
Comment options

@jenningsb2
Comment options

Answer selected by jenningsb2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants