In a previous message I described 2 batch files that use Yarn's
decrypt mechanism to filter the currently viewed message through any
program. There are a few details you should know about
yarn's behaviour to make batch files like these work:
When you Press the key ``X'' (capital X) while viewing a message, the
this menu appears:
Decrypt to display
Decrypt to file
Decrypt to folder
If you pick, ``Decrypt to display'' Yarn does the following:
1) Writes the entire current message, including header, to a file
it names, ``message'', in your yarn, home directory.
2) Replaces the %f key letters in the statement:
decrypt-view=C:\yarn\process.bat %f
in your yarn, config file with the full path name of the ``message''
file. For example, %f may become, C:\yarn\john\message
3) Yarn does not clean up after itself and delete the ``message'' file,
after, process.bat has run. Your program must delete this file itself,
or it will stay in your home directory.
If you pick either ``Decrypt to to file'' or ``Decrypt to folder''
Yarn behaves in a more complex way:
1) It writes three(3) files to your home directory:
``cipher'' contains the body of your current message, but no header.
``header'' contains the header of your current message, but no body.
``message'' contains the entire message, header and body.
2) It replaces %f and %o respectively in the statement:
decrypt=C:\yarn\process.bat %f %o
in your config file with the full path of the ``cipher'' file, for
instance c:\yarn\john\cipher, and the full pathname of a non-existant
file, that it calls: c:\yarn\john\body.
In your config file you must include both the %f and the %o key
letters in the decrypt line above. Even if your batch file or
program does not use the %o filename, yarn seems to freeze
the screen unless it sees this key letter in the decrypt definition.
4) After your program or batch file runs, yarn does this:
It combines the contents of the file, ``header,'' and the file,
``body,'' into one file and appends this new file to the file or
folder you specified in the screen prompt, ``Decript to file/folder ''
Therefore, your program or batch files must either create the
file ``body'' with processed text, or append processed text
to the file, ``header'', for this option to work.
Yarn does clean up after itself after process.bat or your other
program runs. It deletes the files, ``header'', ``message'',
``cipher'' and ``body'' (if there is one).
In your batch file or program, you should either work with full path
names, or (as my batch file did), change to your home directory.
Otherwise, yarn will not find the temporary files it needs to save
the processed text to a file or folder.
Thats it -- happy filtering, and of course your milage may vary.
howard