home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / fish / disks / d1084.lha / Programs / MathScript / Rexx / InsertFormula.ms < prev    next >
Text File  |  1995-03-21  |  1KB  |  73 lines

  1. /* This script is for the use with FinalWriter®.
  2. For the detailed description of how to connect MathScript and FinalWriter® 
  3. via ARexx, see the file FinalWriter.guide in your Docs drawer */
  4.  
  5. options results
  6.  
  7. IF ~SHOW('p',"FINALW.1") THEN EXIT
  8. /* If FW does not run -> quit */
  9.  
  10. DO i=0 WHILE EXISTS("T:formula"||i)
  11. END
  12.  
  13. ADDRESS FINALW.1
  14.  
  15. STATUS FONTSIZE
  16. size=result
  17. /* The formula will be created with the same font size */
  18.  
  19. STATUS PAGE "Insert"
  20. page=result
  21. /* The formula will be inserted into the current page */
  22.  
  23. ADDRESS "MATHSCRIPT.1"
  24.  
  25. GETGENERALPREFS FONTSIZE
  26. old_size=result
  27.  
  28. SETGENERALPREFS FONTSIZE size
  29. /* Use the current font size */
  30.  
  31. GETDIMENSIONS
  32. dimensions=result
  33. w=WORD(dimensions,1)*10
  34. h=WORD(dimensions,2)*10
  35. /* Get the formula's size in micropoints */
  36.  
  37.  
  38. EXPORT BINEPS "T:formula"||i FORCE
  39. /* save as Binary EPS */
  40.  
  41. SETGENERALPREFS FONTSIZE old_size
  42.  
  43. ADDRESS "FINALW.1"
  44.  
  45. SETMEASURE MICROPOINTS
  46.  
  47. CURRENTOBJECT
  48. id=result
  49.  
  50. x=-1
  51. y=-1
  52.  
  53. IF id~=0 THEN 
  54. DO
  55.         GETOBJECTCOORDS id
  56.         page=WORD(result,1)
  57.         x=WORD(result,2)
  58.         y=WORD(result,3)
  59.         DELETEOBJECT id
  60. END
  61. /* Use position of selected object (if there is one) */
  62.  
  63. SCREENTOFRONT
  64.  
  65. IMPORTPREFS DISPLAY PREVIEW TEXTFLOW NONE LINKED NO
  66.  
  67. INSERTIMAGE "T:formula"||i POSITION page x y w h
  68. /* load the EPS-file into FW */
  69.  
  70. REDRAW
  71.  
  72.  
  73.