Hello All

  I've found away around the problem of Microdot breaking threads, after
you've re-edited a message from the 'spool'.

  The script only requires two things to be edited by you and they are,
the path to 'Snoopdos', should it not be in you system path, and the
path to you chosen text editor. It helps if your editor has a 'Save
force', option, in order to overwrite the old file, without question.
 You can make a button for it in the 'message list window' too.
  To see the new version of the message you will need to close and then
re-open the message.

  If for some reason it fails to work, tell me what happend and send me
a copy of the file 'T:SnoopMD'.


---- 8<  cut here ----

/*
 Send a Microdot message to an external editor
 VER$ 1.2 by Jules (JA888) ReEditMD.mdrx
 Create a button in your 'Message list window'
 'Action' string, put the path of this script
 */

OPTIONS RESULTS

/*
 The path to your editor. Example EDITO="SYS:TOOLS/EDITPAD"
 */
EDITO="BED:BED"

/*
 And the path of Snoopdos. Example SNOOP="SYS:Tools/Snoopdos"
 */
SNOOP="SNOOPDOS"

/*
 Check that Microdot is running
 */
IF ~SHOW('P','MD.1') THEN DO
    EXIT
    END

/*
 Check if SnoopDos is running; if not, then start it
 */
SNOOPPATH="RUN >NIL: "||SNOOP||" HIDEMETHOD=TOOLSMENU HIDE"

IF ~SHOW('P','SNOOPDOS') THEN DO
    ADDRESS COMMAND SNOOPPATH
    ADDRESS COMMAND "WAITFORPORT SNOOPDOS"
    END

/*
 Set up Snoopdos
 */
ADDRESS SNOOPDOS ; CLEARBUFFER ; FORMAT "%50n"

/*
 Read the message in MD-II
 */
ADDRESS MD.1 ; READSELECTEDMSGS ; ADDRESS COMMAND 'WAIT 1'

/*
 Save the SnoopDos Buffer
 */
ADDRESS SNOOPDOS ; SAVEBUFFER "T:SnoopMD"

/*
 Find the correct line.
 */
DETEC=0 ; PDRAW="" ; DFILE=""
CALL OPEN('MD','T:SnoopMD','R')
DO UNTIL DETEC>1 ; PDRAW=READLN('MD') ; DETEC=POS('DBX_',PDRAW) ; END
DFILE=READLN('MD')
CALL CLOSE('MD')
QUIT

/*
 Give it a hair cut
 */
TARGETFILE=TRIM(PDRAW)||"/"||TRIM(DFILE)

/*
 Send it to the editor
 */
ADDRESS COMMAND EDITO TARGETFILE

EXIT

---- 8< and here ----

--
Regards
  Jules

Reply via email to