I would think that you could run this on Windows as well as long as you have Python installed. Have you tried that?
It would also be more accurate to describe this as a script that creates a JSON file with the contents of a directory that can be imported into TW, rather than a TW plugin.
Another approach is to generate a list of folders into a text file then import that as a tiddler. Once in your wiki you can build a tool to generate folder tiddlers all with wiki text and widgets.
No I’ve not looked into that… I used to have Python installed but I seem to have deleted it. I have to admit I didn’t realise that was required, although I wondered by there was a .py file listed in the repository.
Okay, fair cop… I was just going by how this was listed in the Newsletter and guess I should have looked more closely before I posted
I have considered this sort of approach… but, of course, I was hoping for something a little more seamless and less error prone. In fact I was hoping that it wouldn’t be too hard to create something akin to File Explorer (on Windows) or any similar file listing gizmo but with the added advantage of adding text/links/whatever to provide background to the contents of the folder.
I fear my skills are not up to it but I’d be interested in hearing your further thoughts.
The main problem is, that the browser vendors don’t let us directly read directory content or file content without explicit user interaction. For security reasons, there has to be at least .. the browser file open dialogue. We cannot avoid that.
Even with browser AddOns the possibilities are limited.
So if there is an external mechanism that can run independently from the user, that builds a tiddlers.JSON file it will be much easier on the TW side of things
But you’ll then have to clean up the file with a text editor. Or, you can write a routine in TW that can extract the data, change \ to /, and create tiddlers that can then be viewed as a structure using the tree macro. You can then use the official comments plugin to annotate the various file tiddlers.
In theory you could also use the official Excel importer to bring in the CSV, but you would have to clean the text, import it to excel, and then export it to xlsx, then import into TW … so the roll-your-own approach is probably easier long-term.
I did have a very short look about possibilities with PowerShell on Windows. … There are pretty powerful commands. … But to create something usable it would probably need 4h, since I don’t know PS all too well.
eg:
Get-ChildItem -Directory -Recurse … Which returns a recursive list of directories starting from the current directory.
Get-ChildItem -Recurse … will return files and directories. … There only needs to be some filtering since it also shows “.git” … “hidden” files which we probably don’t want on Win.
Many thanks for all the contributions and apologies for my lack of comment - eight hours in the undergraduate teaching laboratory means I’m a bit frazzled. I will investigate the suggestions when some sort of capability returns.
To capture all folders and subfulders in windows to a file for use in tiddlywiki use the following at the command prompt
dir /s/b /ad > output.txt
output.txt
The second line will open the result in Notepad or the text editor. I like Notepad++
Be aware that modern windows installed have thousands of folders especially under systems folders, these are best avoided perhaps sticking to everything under the documents folder.
Often the path above the documents folder is quite long to start with so it may be wise to remove the prefix. eg: C:/Users\*user*\*onedrive*\Documents and add the prefix back if needed. I did this in Notepad++
Once you copy/import this content into a tiddler, you can set the tiddler to type text/plain. Then access each row using splitregexp[\n].