List files in a bookmark to populate a prompt

Hello Drafts collective brain,

Would anyone know how to list all the files in a bookmarked folder and feed those file names into a popup prompt ? The idea is that I would like to select to which of those existing files I append my [draft] through a prompt.

Thank you !

You can create FileManager objects that point to a Bookmark folder. Example code on Bookmark object documentation page.

FileManager has methods to list files.

Hopefully, that points you in the right direction.

1 Like