Skip to content

list of files inside folder #364

Discussion options

You must be logged in to vote

Here is my snippet that does the following:

  1. ask user to select folder to generate MOC with bulleted list (create new file) of all files in this folder
  2. all files in subfolders will be included
  3. if file exist, do not create file

It is ugly but it works for me

<%*  
// ask user to select folder to generate MOC for all files in this folder
// all files in subfolders will be included
const folders = this.app.vault.getAllLoadedFiles().filter(i => i.children).map(folder => folder.path);
const folderChoicePath = await tp.system.suggester(folders, folders);
if (folderChoicePath != null) {
	new Notice(`Folder selected: ${folderChoicePath}`, 5000);

	const files = app.vault.getMarkdownFiles();
	const 

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@imed-ghomari
Comment options

@willasm
Comment options

@joeraad
Comment options

@tusharshuklaa
Comment options

@imed-ghomari
Comment options

Answer selected by SilentVoid13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
5 participants