/*$VER: YAMtoV.rexx 1.0 John Pullicino (20-12-98) Converts the selected YAM message to HTML and sends it to Voyager */ /* based on HTMurL by Emrah Baskaya */ options results LF = '0a'x qu = '"' ob = '' address 'YAM' getmailinfo file ifile = result getmailinfo subject subject = result subject = translate(subject,"{}","<>") getfolderinfo num fn = result getmailinfo from from = result ofile = 'Ram:YAM-'fn'.'||substr(ifile, max(lastpos('/',ifile),lastpos(':',ifile)) + 1)'.html' intro = ''LF''LF''LF' >> 'subject' -- 'from''LF||, ''LF||, ''LF' 'LF'

  • Subject : 'subject'
  • From : 'from'

  • '
    
    outro = '

    Created by : YAMtoV.rexx © 1998 John Pullicino email: jjpull@pac.com.au

    ' sm.1 = 'HTTP://' sm.2 = '@' if ~open('1input',ifile,'R') then exit if open('1test',ofile,'R') then call cleanmem if fexit = 1 then do call close('1input') exit end if ~open('1otput',ofile,'W') then do call close('1input') exit end call writeln('1otput',intro) founp = 0 exitt = 0 bmail = 0 do forever if eof('1input') then bmail = 1 if bmail then leave satir = readln('1input') if satir = "" then leave end if bmail then do call close('1input') call open('1input',ifile,'R') end do forever satir = readln('1input') satir = translate(satir,"{}","<>") uptir = upper(satir) ender = 0 ofset = 1 towri = "" do while ~ender a = pos(sm.1,uptir,ofset) b = pos(sm.2,uptir,ofset) tower = a > 0 & b > 0 if tower then z = min(a,b) else z = a + b if z > 0 then do towri = towri||substr(satir, ofset, z - ofset) ofset = z k = max(lastpos(' ',towri),lastpos('{',towri),lastpos('(',towri)) ps = pos(' ',satir,ofset) pl = pos('}',satir,ofset) pw = pos(')',satir,ofset) if ps > 0 & pl > 0 then w = min(ps,pl) else w = pl + ps if w > 0 & pw > 0 then w = min(w,pw) else w = w + pw if w = 0 then w = length(satir) + 1 towri = towri||substr(satir, ofset, w - ofset) if b = z then do mailt = word(substr(towri,k + 1),1) inser = ob'mailto:' added = qu'>'mailt||cb end else do uuurl = word(substr(towri,k + 1),1) inser = ob added = qu'>'uuurl||cb end towri = insert(inser,towri,k)||added ofset = w end else ender = 1 end towri = towri||substr(satir, ofset) if eof('1input') | exitt then leave if pos("CONTENT-TYPE",uptir) > 0 & pos("TEXT/PLAIN",uptir) = 0 then leave call writeln('1otput', towri) end call writeln('1otput',outro) call close('1input') call close('1otput') call sendtobrowser exit sendtobrowser: runbr='C:RUN >NIL: VOYAGER:V' sov = 0 local = '"'||'file:///'ofile'"' if show('P','VOYAGER') then do address 'VOYAGER' show openurl local screentofront sov = 1 end if ~show('P','VOYAGER') then do Address Command runbr local do 5 while ~show(p,portname) Address Command 'SYS:REXXC/WAITFORPORT 'portname end return exit