elfin's & esmi's scripts


efix

An evolving script which at present can correct Outlook Express's faulty sig seperator,
from "--" to "-- ". It also corrects the problem of trailing spaces/lines at the end of a message. Although written primarily for OE it should work with any newsreader.

We intend to alter the script shortly to include:

Download the latest version : efix (4kb) : which include 1 script, 1 new module, and 2 renamed modules. This will ensure that the fix still works even if the original Hamster modules are overwritten.


The script

#!hs2
trace(1)
#!load emessage.hsm
#!load efix.hsm

var( $news)
$news="Groups\News.Out\"
if( fileexists( $news + "*.msg"))
   sigfix( $news )
endif

The module

#!load emessage.hsm

################
#   sigfix
################
# Corrects faulty .sigs by adding a single space to '--'
#
#    IN: $news (name of folder containing posts awaiting sending)
#    OUT: rewrite of .sig line where it previously lacked whitespace
#

sub sigfix( $news )

var( $n, $article, $folder, $Msg, $lnum, $line )
$folder = ListAlloc
$Msg = ListAlloc
ListFiles( $folder, HamPath + $news+"/*.msg" )
$n = 0
while( $n < ListCount($folder) )
  $article=ListGet($folder,$n)
  ListLoad( $Msg, HamPath + $news + $article )
  $lnum=( ListCount( $Msg )-1)
  while( $lnum > 0 )
     $line=ListGet( $Msg,$lnum )
     if (len( $line ) = 0)
       ListDelete( $Msg, $lnum)
       ListSave( $Msg, HamPath + $news + $article )
     else
       if ( pos( "--", $line) = 1 && len( $line ) = 2)
         ListSet( $Msg, $lnum, "-- " )
         ListSave( $Msg, HamPath + $news + $article )
         break
       endif
     endif
   dec($lnum)
  until( pos( "-- ", $line) = 1)
  listclear( $Msg )
  inc( $n )
endwhile
listfree( $folder )
listfree( $Msg )

endsub


Accounts| autoscripts| configuring| Links| mail filters| newsreader| OE5faq| scoring| scripts| Settings| tips| tools
New English Help Files | Hamster Index