Schematic Tools Module
Posted: Fri Jul 05, 2019 7:53 pm
I've long wished that FlowStone had a "Save as a Copy..." menu item, so that I could save a quick backup but carry on using the current file as my main working version. Being able to avoid all the WIndows file dialogues would be even better! And how about all those project sub-folders of presets that I made and snippets of Ruby code?!
A full on source-code manager like Git seems like overkill - but FlowStone and Ruby have (nearly) all the tools to do exactly what I need. So I made a little module that can sit at the top of my schematics to take the donkey work out of managing backups. The module can...
- Back up the current schematic plus any resource files that belong to the project to a unique sub-folder within a nominated backups folder. If the schematic folder itself is nested within parent project folders, no problem - the source folder can also be nominated so that the whole lot is backed up.
- Folder paths can be absolute or relative to the schematic's folder, and may include automatic substitutions for the schematic name, date and/or time. Date and time stamps are formatted so that they sort into time order. If that still doesn't make each backup's folder name unique, an auto-incrementing index is automatically added.
- Any files and/or folders may be excluded from backing up by giving a list of filters, which may use the usual Windows file path wild-cards for matching. For example *.txt would prevent text files from being backed up.
- The option to pop-up a confirmation dialogue before saving anything. A list of the files which would be saved are available at a module output so that you can check that everything's set up OK before committing.
- An area to scribble notes which will be included as a text file within the backup folder.
- Buttons to open the schematic folder or the backups folder in Windows explorer.
- Buttons to copy the schematic's full path, the schematic's folder path, or the backups folder path to the Windows clipboard.
The only thing I haven't worked out yet is how to make it press CTRL-S first so that I definitely get the current edits into the backup - so I can't completely exclude my ailing memory from mucking things up just yet!!
A full on source-code manager like Git seems like overkill - but FlowStone and Ruby have (nearly) all the tools to do exactly what I need. So I made a little module that can sit at the top of my schematics to take the donkey work out of managing backups. The module can...
- Back up the current schematic plus any resource files that belong to the project to a unique sub-folder within a nominated backups folder. If the schematic folder itself is nested within parent project folders, no problem - the source folder can also be nominated so that the whole lot is backed up.
- Folder paths can be absolute or relative to the schematic's folder, and may include automatic substitutions for the schematic name, date and/or time. Date and time stamps are formatted so that they sort into time order. If that still doesn't make each backup's folder name unique, an auto-incrementing index is automatically added.
- Any files and/or folders may be excluded from backing up by giving a list of filters, which may use the usual Windows file path wild-cards for matching. For example *.txt would prevent text files from being backed up.
- The option to pop-up a confirmation dialogue before saving anything. A list of the files which would be saved are available at a module output so that you can check that everything's set up OK before committing.
- An area to scribble notes which will be included as a text file within the backup folder.
- Buttons to open the schematic folder or the backups folder in Windows explorer.
- Buttons to copy the schematic's full path, the schematic's folder path, or the backups folder path to the Windows clipboard.
The only thing I haven't worked out yet is how to make it press CTRL-S first so that I definitely get the current edits into the backup - so I can't completely exclude my ailing memory from mucking things up just yet!!