home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 216.lha / RexxArpLib_v2.1 / rexx / TxEdStuff / txedtexify.txed < prev    next >
Encoding:
Text File  |  1996-02-15  |  2.0 KB  |  79 lines

  1. /*   This file texify's its argument */
  2. OPTIONS results
  3.  
  4.   filename = "tempfromtxed.tex"
  5.  
  6. STATUS F
  7.  
  8.   if result ~= "" then filename = result
  9. dev = ""
  10. subdir = ""
  11.  
  12. STATUS D
  13.  
  14.     directory = result
  15.     if directory = "" then directory = ":"
  16.     else parse var directory dev ":" subdir
  17.     if subdir = "" then directory = dev":"
  18.     else directory = dev":"subdir"/"
  19.  
  20.     address command  "c:copy "directory||filename "to ram:"filename"_backup"
  21.     working_directory = directory
  22.  
  23.     call CheckForFile()
  24.     call CheckForTex()
  25.     if  ~showlist('p','TeX:dvistream') then call CheckForPreview()
  26.     call StopTex()
  27.  
  28.  
  29.     address 'AmigaTeX'
  30.     'TeXify' working_directory||filename    /* send the current file */
  31.  
  32. exit
  33.  
  34. CheckForTex:    /* Check to see if Tex is up */
  35.     if ~showlist('P','AmigaTeX') then do    
  36.        WINDOW 0 0 screencols()-10 screenrows() - 80
  37.        constring = "newwsh con:0/"screenrows()-79"/"screencols()-10"/79/'TeXWindow' CMD rexx:startup_tex.rexx"
  38.        interpret address COMMAND '"'constring'"' 
  39.  
  40.        do until showlist('p','AmigaTeX')
  41.           address COMMAND 'c:WaitForPort "AmigaTeX"'    
  42.                             /* give things time to get going */
  43.        end
  44.     end
  45. return 0
  46.  
  47. CheckForPreview:   /* Check for previewer being up if TeX is up */
  48.        if ~showlist('P','TeX:dvistream') then address command runwsh preview     
  49.        do until showlist('p','TeX:dvistream')
  50.           address COMMAND 'c:WaitForPort "TeX:dvistream"'    
  51.                             /* give things time to get going */
  52.        end
  53. return 0
  54.  
  55. StopTex:
  56.  
  57.     do istop=1 to 50
  58.       address 'AmigaTeX' 'Abort'
  59.       if RC=0 then leave istop        /* If it is doing something stop it */
  60.     end 
  61.  
  62. return 0
  63.  
  64. CheckForFile:
  65.     answer = OKAY
  66.  
  67.     if directory ~= "vd0:" then do
  68.     question = "Do you want to work from vd0: or the original disk ?"    
  69.     answer = request(100,100,question,,"vd0:","original dir",) 
  70.     end
  71.  
  72.     if answer = OKAY then do
  73.  
  74.          working_directory = "vd0:"
  75.          SAVeas working_directory||filename
  76.     end 
  77.     else SAVeas directory||filename
  78. return
  79.