Another powershell script to work with TiddlyWiki default download saver

I wrote a Powershell script for the express purpose of handling TiddlyWiki files saved using TiddlyWiki default download saver. It will monitor browser download path for files matching a filename pattern and move it to a specific path, and optionally backing up past files. Inspired by https://groups.google.com/g/tiddlywiki/c/lPDUD66GBD8/m/nyxytP_DEwAJ

Link: GitHub - whjou/tw-mbm

4 Likes

Have you seen POLLY by @Mark_S? … GitHub - Marxsal/polly: Batch file system to restore TiddlyWiki files from download directory to their original home directory

Just asking :slight_smile:, TT

1 Like

@whjou Welcome to the forum!

Thanks for letting us know about your project. IMO the readme should also contain some info, how it can be started.

I would like to experiment with this but are;

  • A little reluctant to run it on my machine because I am not sure of the consequences
  • Would value a little more config control but need to read up on powershell first
    • eg; Can you add additional “MonitorPath’s”

Also I assume this solution

  • Can only save/move to downloads folder or below?

In the long run I have some ideas that would help use tiddlywiki as a Powershell development kit and repository and you could publish this as a “powershell tiddler”.

In fact, no. But it’s a nice and well thought out. script that I would like to try too. The primary difference that my script does is that it sets up a FileSystemWatcher to monitor files changes in a directory with callback instead of polling. The idle loop is just to prevent the script from exiting.

It can handle arbitrary folders. In my personal set up $MovePath is in My Documents folder and $BackupPath is somewhere else.

And it is wise to not run the script without checking it out first. I am aware of multiple scenarios that the script will fail terribly (e.g. other files in the $MonitorPath matching the $MonitorFile will get moved regardless of contents, the file gets moved before antivirus scanner did their job etc.). If you wish to be cautious you can comment out the “Remove-Item” lines so at least you can be sure nothing will be deleted…