The code is not "Pretty"
It is not "polished"
It is not "optimized"
It is not 100% complete... (and I don't know when I will have time to finish it)
But is currently functional - so I thought I'd offer it to anyone who might be interested in this sort of thing.
Here are examples of what it does (notice an "INIT" is run first):
You can see that different STYLES (info1, warn1, block1, stop1) are applied to the same text. In the last example a "PAUSE" command is embedded right into the style.
A 2nd mode I call "FlexStyles" can also be used - originally meant for hierarchical display - for example this code produces the result below:
Code: Select all
%fStyle_01Begin%
%FlexStyle% l1 "JOB xxxxxxx Completion Statistics"
%FlexStyle% l2 Error Summary
%FlexStyle% l3 2 copy failures
%FlexStyle% l4 \\source\folder1\folder2\file1.xxx
%FlexStyle% l4 \\source\folder1\folder2\file2.xxx
%FlexStyle% line4
%FlexStyle% l2 Total elapsed time: 00:00:00
%FlexStyle% l2 Total files processed: x,xxx
%fStyle_01End%
Or you can display the same text using an alternate style:
Code: Select all
%fStyle_02Begin%
%FlexStyle% l1 "JOB xxxxxxx Completion Statistics"
%FlexStyle% l2 Error Summary
%FlexStyle% l3 2 copy failures
%FlexStyle% l4 \\source\folder1\folder2\file1.xxx
%FlexStyle% l4 \\source\folder1\folder2\file2.xxx
%FlexStyle% line4
%FlexStyle% l2 Total elapsed time: 00:00:00
%FlexStyle% l2 Total files processed: x,xxx
%fStyle_02End%
A bit more info below.
Code: Select all
Purpose:
This script allows the creation of a collection of "styles" which can be called from other scripts.
The attempt was made to allow for minimal syntax requirements while adding color functionality
There are a few pre-defined "styles" already included but it is meant for user customization.
Each "style" is defined by a set of properties (colors, text elements, newline entry, etc.).
It has functionality to allow running of external commands both PRE-style display...
and POST style display.
For example, you could insert a "pause" command after a "Critical_ERROR" style...
OR GRAB a TIMESTAMP before starting a process, etc.
The number of pre/post run commands is flexible and can be increased as needed with...
the simple addition of a property like this: "PreCMD_03=GetTimeStamp.cmd xxxx"
Properties (including pre/post run commands) can be set as GLOBAL defaults and/or ...
on a per-style basis.
The "HELP" functionality can enumerate all defined styles, their command-line usage, ...
and display them as they would appear on-screen
Help screen:
My batch coding skills are not great so if you guys think this concept is useful, I would welcome addition features, special character handling, code optimization, etc. There is still leftover and debug code all through the script so please don't mind my mess
I've uploaded it here: https://storage-eu.gmx.com/qx/gmx_com_e ... 3Aexplorer
Password is DOSTIPS
Remember, will also need this (see link at beginning of post):
Code: Select all
DEPENDENCIES:
Credit to Antonio Perez Ayala for these utilities
Colorshow.exe
Textcolor.exe
Cursorpos.exe