> I never say those messages could some one send them to me
> please?
Sorry folks (and to Bob). I just discovered that I probably never sent
Part 1 to the yarn listserv, and the people I did send it to got a rough
draft instead of the post I intended. So here is a re-post for all those
interested:
**************************************************
Steve Sawczyn wrote:
> Ideally, I could open a message and, if I found that it contained many
> signs, could somehow invoke a filter which would result in just the
> message, without the >, being displayed. Saving this modified version
> of a message would be useful, but definitely not necessary.
I think I have a nice solution that does exactly what you want. Yarn
lets you press a key to decrypt a current message, and save it to a file
or view it, at your option. My idea is to use this mechanism to process
a current message through ANY filter program, not just a decryption
program.
To do this, open the ``config'' file, in your yarn home directory (the
directory that the variable HOME is set to). Uncomment and change the
following 2 lines:
decrypt=C:\yarn\process.bat %f %o
decrypt-view=C:\yarn\process.bat %f %o
``process.bat'' is a (sample) batch file I reproduce below. Either put
this batch file in a directory that is part of your PATH variable, or
give its full pathname, as above.
Now open yarn and view a message. Press the key ``X'' (capital X) and the
following menu appears:
Decrypt to display
Decrypt to file
Decrypt to folder
Choose Decrypt to display, to strip the current message of quote marks
display the filtered results, using the ``more'' viewer. I dont know
how your speech software works, but I hope it can simply read the text
that more puts on your screen.
If you choose one of the other 2 options, yarn prompts for a filename:
Decript to folder:
Decript to file:
After you enter the name of a yarn folder, or text file, Yarn appends
the processed message to this file or folder.
Thats it -- 2 keystrokes to process a current through any filter you
want, view the results, or save the resulting file to a file or folder.
Here is a batch file that filters out quote marks (>), using sed:
---------------------------BEGIN PROCESS.BAT--------------------------
chdir %1\..
sed.exe "/^ *>/s/^[ ]*>*/ /" %1 > body
if "%2"=="" goto view
goto end
:view
more <body
pause
del %1
del body
:end
-----------------------------END PROCESS.BAT----------------------
You were also interested in filtering HTML messages. Here is an
expanded version of PROCESS.BAT that gives you a menu of 2 filters
to choose from: sed for filtering out quote symbols, or Bruce
Gutherie's ``htmstrip'' program for filtering out html tags: (htmstrip
is one of the better small programs for formatting html messages as text.)
---------------------------BEGIN PROCESS.BAT--------------------------
chdir %1\..
cls
echo.
echo Remove [Q]ote marks
echo Remove [H]tml codes
echo.
choice /C:QH /TQ,09 " Choose an Option "
if errorlevel 2 goto html
if errorlevel 1 goto quotes
:html
htmstrip.exe %1. body. /all
goto continue
:quotes
sed.exe "/^ *>/s/^[ ]*>*/ /" %1 > body
:continue
if "%2"=="" goto view
goto end
:view
more <body
pause
del %1
del body
:end
-----------------------------END PROCESS.BAT----------------------
This lets you pick a filter for viewing or saving a message, using
3 keystrokes. Clearly the menu can include any type of filter or viewer,
an html filter, a decryptor, etc. This menu serves a function similar
to the metamail program. However, the message does not need to have
MIME formatted lines in it telling yarn, ``This is a MIME multi-part
message.'' etc.
For those who enjoy the gory details, I will post a follow up article
explaining how these batch files work with yarn's way of saving temporary
message files.
Howard Schwartz
------------------------
theo@ncal.verio.com