REMSCR 1.20 - a (MM-)ToolBook script remover
written by Thomas Lopatic (lopatic@informatik.uni-muenchen.de)

[This is the README.TXT of release 1.00 of REMSCR. Look at the
file CHANGES.TXT to see what has changed since 1.00. If you're
already familiar with REMSCR 1.00, you might want to skip the rest
of this file.]

Since Asymetrix doesn't provide utilities to remove scripts from
MMTB applications to us ordinary users, I've hacked up a little tool
to accomplish this. However, the structure of a ToolBook file is not
documented, so I had to use a small workaround. This utility modifies
the ToolBook file it is used on. SO MAKE SURE THAT YOU HAVE A
BACKUP. ALL SCRIPTS ARE IRREVERSIBLY ERASED FROM THE TOOLBOOK FILE.
I've been checking the program with various ToolBook files, but I
cannot guarantee that it works in all cases. I cannot think of any
cases in which it shouldn't work, though. Just follow the steps
described below. You SHOULD nevertheless TEST your stripped appli-
cations. THE RISK OF USING THIS PROGRAM IS UP TO YOU.

Each script is stored twice in a ToolBook file. Once in compiled
form, once in sort of plain text (commands are replaced by one
byte tokens, e. g. 'to' becomes 0x80, 'handle' becomes 0x81, etc.).
The plain text version is preceeded by two bytes of length infor-
mation. So without knowing anything but this about the structure
of a ToolBook file, we can write a small program that looks for
a script by searching the ToolBook file for a certain piece of text.
That's what REMSCR is about.

To use REMSCR, the first line of a script to be removed must be the
comment '-- REMOVE THIS SCRIPT' (without the single quotes). REMSCR
searches a ToolBook file for this string and then skips back two
bytes to read the length info for the script. This is why the comment
MUST BE THE FIRST LINE of the script. Having determined the length
of the plain text script, REMSCR overwrites the script with 0x00
bytes and sets the length info to zero, thus removing the script
irreversibly from the ToolBook file.

Step by step instructions:

1. Insert the comment '-- REMOVE THIS SCRIPT' as FIRST line into all the
   scripts you want to remove from your book. It must be the FIRST line,
   not even preceeded by empty lines. REMSCR doesn't check for this and
   will most likely crash if the comment isn't the first line of the
   script.

2. Save the book with a different name using 'Save As'. This makes sure
   that every script is contained exactly once in the book. Otherwise
   ToolBook seems to merely append the changed script (the one with the
   comment) to your ToolBook file. Moreover this forces you to use
   REMSCR on a copy of your ToolBook file.

3. Switch to DOS and run 'remscr book.tbk' where 'book.tbk' must be
   replaced by the name of your ToolBook file. All scripts containing
   the comment will be erased.

I've tested REMSCR with various MMTB 3.0 files. I don't have any idea
whether it also works with TB 3.0 files or earlier versions of TB and
MMTB. Please give me feedback on this. Please do also report any pro-
blems or suggestions you have.

This archive contains the source code for REMSCR and an executable
compiled with the Borland C++ 3.1 package. Both files are distributed
as beerware. That means you may copy them, use them commercially, do
whatever you want with them. However, if you've found them to be use-
ful, you have to buy me a beer in case we meet some day.

Greetings,
-Thomas

