home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / ftnote1.zip / FOOTSTRT < prev    next >
Text File  |  1993-11-07  |  30KB  |  692 lines

  1. !       filename FOOTSTRT      11/06/93
  2. !       The following variables are used in the macros and are declared here.
  3. VAR placeMarker
  4. VAR tagPageNumber
  5. VAR framePageNumber
  6. VAR count
  7. VAR message
  8. VAR currentFrameName
  9. VAR preserveStylePalette 
  10. VAR holdFrameName
  11. VAR oops
  12. VAR oopsMessage
  13. VAR addedFootnotes
  14. VAR previousFootnoteCount
  15. VAR currentFootnoteCount
  16. VAR charAtCursor
  17. VAR preserveStatus
  18. VAR adjustMessage
  19. VAR upDownMessage
  20. VAR misplacedMessage
  21. VAR problemCount
  22. VAR lors
  23. VAR loopCount
  24. VAR endMessage
  25. VAR spacingIncrement
  26. VAR leadingIncrement
  27. VAR spacePoints
  28. VAR leadPoints
  29. VAR newFootnote
  30. VAR newFootnoteMessage
  31. VAR forceFootnoteRedo
  32. VAR footnoteNumber
  33. VAR readCharAtCursor
  34. VAR startingFrameName
  35. VAR nothingToDo
  36. VAR describeSubdir
  37. VAR macroSubdir
  38. VAR footnotePath
  39. PROCEDURE QuitMacro
  40.         IF preserveStylePalette = "not visible" THEN                   ! tests to see if the Style Palette was originally turned off 
  41.                 StylePaletteVisible                                               ! if it was, this COMMAND toggles it back to OFF
  42.         ELSE
  43.         END IF
  44.         IF preserveStatus = "not visble" THEN                            ! tests to see if the status line was originally turned off
  45.                 SET DocPrefShowStatus TO FALSE                ! if it was, it turns it back off.
  46.         ELSE
  47.         END IF
  48.         SET SelectedFrame TO currentFrameName
  49.         SET CursorPosition TO placeMarker
  50.         SET StatusMessage TO "All footnotes have been created"
  51.         IF c = "manual end" THEN
  52.                 SET endMessage TO "REMINDER: Number of misplaced footnotes = "
  53.                 CONVERT problemCount TOSTRING problemCount
  54.                 SET endMessage TO endMessage + problemCount
  55.                 MSG endMessage
  56.         ELSE
  57.                 IF nothingToDo = "on" THEN
  58.                         MSG "There was nothing to do, all footnote frames have been removed"
  59.                 ELSE
  60.                         IF loopCount = 1 THEN
  61.                                 MSG "The footnotes were created successfully the first time"
  62.                         ELSE
  63.                                 CONVERT loopCount TOSTRING loopCount
  64.                                 SET endMessage  TO "The footnotes were created in " + loopCount
  65.                                 SET endMessage TO endMessage + " tries"
  66.                                 IF c = "manual end" THEN
  67.                                 ELSE
  68.                                         MSG endMessage
  69.                                 END IF
  70.                         END IF
  71.                 END IF
  72.         END IF
  73. QUIT
  74. END PROCEDURE
  75.  
  76. PROCEDURE DeleteFootnoteFrames
  77.         SET holdFrameName TO FrameName
  78.         SET SelectedFrame TO "footnote data"
  79.         CursorHome
  80.         REPEAT
  81.                 DefineToWordEnd
  82.                 CopyToClipboard
  83.                 SET x TO PastedClipboard
  84.                 CancelDefinedBlock
  85.                 IF x = "0" THEN
  86.                         EXIT 
  87.                 ELSE
  88.                         IF x = "01" THEN
  89.                                 EXIT
  90.                         ELSE
  91.                                 SET y TO "footnote" + x
  92.                                 GoToLinkTag y
  93.                                 DeleteFrame
  94.                                 SET SelectedFrame TO "footnote data"
  95.                                 TableCellTab
  96.                                 TableCellTab
  97.                                 DefineToWordEnd
  98.                                 CopyToClipboard
  99.                                 SET x TO PastedClipboard
  100.                                 CancelDefinedBlock
  101.                                 DeleteLinkTag x
  102.                                 TableCellTab
  103.                                 TableCellTab
  104.                                 TableCellTab
  105.                         END IF
  106.                 END IF
  107.         END REPEAT
  108.         CancelDefinedBlock
  109.         SET SelectedFrame TO "footnote data"
  110.         DeleteFrame
  111.         DeleteLinkTag "footnote data"
  112.         SET SelectedFrame TO holdFrameName
  113.         SET forceFootnoteRedo TO "off"
  114. END PROCEDURE
  115.  
  116. PROCEDURE CheckIfOnSamePage
  117.         SET Env1 TO "null"
  118.         SET x TO 1
  119.         SET misplacedMessage TO ""
  120.         SET problemCount TO 0
  121.         SET StatusMessage TO "Checking if footnotes are on the correct page........"
  122.         SET holdFrameName TO FrameName
  123.         SET SelectedFrame TO "footnote data"
  124.         CursorHome
  125.         REPEAT
  126.                 SET holdFrameName TO FrameName
  127.                 SET SelectedFrame TO "footnote data"
  128.                 DefineToWordEnd
  129.                 CopyToClipboard
  130.                 SET z TO PastedClipboard
  131.                 CONVERT z TOSTRING z
  132.                 CancelDefinedBlock
  133.                 TableCellTab
  134.                 TableCellTab
  135.                 DefineToWordEnd
  136.                 CopyToClipboard
  137.                 CancelDefinedBlock
  138.                 TableCellTab
  139.                 TableCellTab
  140.                 TableCellTab
  141.                 SET x TO PastedClipboard
  142.                 CONVERT x TOSTRING x
  143.                 SET LinkTagName TO x
  144.                 SET SelectedFrame TO holdFrameName
  145.                 IF LinkTagExists THEN
  146.                         GoToLinkTag x
  147.                         SET tagPageNumber TO CursorPageNumber
  148.                         SET SelectedFrame TO x
  149.                         SET framePageNumber TO CursorPageNumber
  150.                         CONVERT x TOVALUE x
  151.                         IF framePageNumber = tagPageNumber THEN
  152.                         ELSE
  153.                                 SET problemCount TO problemCount + 1
  154.                                 SET misplacedMessage To misplacedMessage + " "
  155.                                 SET misplacedMessage TO misplacedMessage + z
  156.                                 SET Env1 TO "retry"                                             
  157.                                         IF count = 1 THEN
  158.                                                 SET StatusMessage TO "This footnote is on the wrong page. This can be corrected."
  159.                                                 PAUSE 1
  160.                                         ELSE
  161.                                         END IF
  162.                         END IF
  163.                 ELSE
  164.                 END IF
  165.                 CONVERT x TOVALUE x
  166.                 EXIT WHEN x = 2100
  167.                 EXIT WHEN x = 0
  168.                 SET x TO x + 1
  169.         END REPEAT
  170.         IF problemCount = 1 THEN
  171.                 SET misplacedMessage TO "Footnote"  + misplacedMessage
  172.                 SET misplacedMessage TO misplacedMessage + " is on the wrong page."
  173.         ELSE
  174.                 SET misplacedMessage TO "Footnotes" + misplacedMessage
  175.                 SET misplacedmessage TO misplacedMessage + " are on the wrong pages."
  176.         END IF
  177.         SET SelectedFrame TO "footnote data"
  178.         CursorHome
  179. END PROCEDURE
  180.  
  181. PROCEDURE CheckIfOnSamePageInitial
  182.         SET oops TO "off"
  183.         SET x TO 1
  184.         SET holdFrameName TO FrameName
  185.         SET SelectedFrame TO "footnote data"
  186.         CursorHome
  187.         SET SelectedFrame TO holdFrameName
  188.         REPEAT
  189.                 SET StatusMessage TO "Checking if footnotes are on the correct page........"
  190.                 SET holdFrameName TO FrameName
  191.                 SET SelectedFrame TO "footnote data"
  192.                 DefineToWordEnd
  193.                 CopyToClipboard
  194.                 CancelDefinedBlock
  195.                 SET m TO PastedClipboard
  196.                 TableCellTab
  197.                 TableCellTab
  198.                 DefineToWordEnd
  199.                 CopyToClipboard
  200.                 CancelDefinedBlock
  201.                 TableCellTab
  202.                 TableCellTab
  203.                 TableCellTab
  204.                 SET x TO PastedClipboard
  205.                 EXIT WHEN x = "0"
  206.                 CONVERT x TOSTRING x
  207.                 SET LinkTagName TO x
  208.                 SET SelectedFrame TO holdFrameName
  209.                 IF LinkTagExists THEN
  210.                         GoToLinkTag x
  211.                         SET tagPageNumber TO CursorPageNumber
  212.                         SET SelectedFrame TO x
  213.                         SET framePageNumber TO CursorPageNumber
  214.                         CONVERT x TOVALUE x
  215.                         IF framePageNumber < tagPageNumber THEN
  216.                                 SET m TO "Footnote " + m
  217.                                 SET m TO m + " on Page "
  218.                                 CONVERT framePageNumber TOSTRING framePageNumber
  219.                                 SET m TO m + framePageNumber
  220.                                 SET m TO m + " is before its reference number on Page "
  221.                                 CONVERT tagPageNumber TOSTRING tagPageNumber
  222.                                 SET m TO m + tagPageNumber
  223.                                 SET m TO m + ".        This can be corrected."
  224.                                 SET oops TO "on"
  225.                                 SET StatusMessage TO "This footnote is on the page preceding its reference. This can be corrected."
  226.                                 MSG m
  227.                         ELSE
  228.                                 IF framePageNumber > tagPageNumber THEN
  229.                                         SET m TO "Footnote " + m
  230.                                         SET m TO m + " on Page "
  231.                                         CONVERT framePageNumber TOSTRING framePageNumber
  232.                                         SET m TO m + framePageNumber
  233.                                         SET m TO m + " is after its reference number on Page "
  234.                                         CONVERT tagPageNumber TOSTRING tagPageNumber
  235.                                         SET m TO m + tagPageNumber
  236.                                         SET m TO m + ".        This can be corrected."
  237.                                         SET oops TO "on"
  238.                                         SET StatusMessage TO "This footnote is on the page preceding its reference. This can be corrected."
  239.                                         MSG m
  240.                                 ELSE
  241.                                 END IF
  242.                         END IF
  243.                 ELSE
  244.                         EXIT
  245.                 END IF
  246.                 CONVERT x TOVALUE x
  247.                 EXIT WHEN x = 2100
  248.                 EXIT WHEN x = 0
  249.                 SET x TO x + 1
  250.         END REPEAT
  251.         SET SelectedFrame TO holdFrameName
  252.         IF oops = "on" THEN
  253.         ELSE
  254.                 QUERY "All previous footnotes are correctly placed. Click OK if you've added any or want to continue anyway." TO oopsMessage
  255.                 IF oopsMessage  THEN
  256.                 SET forceFootnoteRedo TO "on"
  257.                 ELSE
  258.                         SET SelectedFrame TO currentFrameName
  259.                         SET CursorPosition TO placeMarker
  260.                         CALL QuitMacro
  261.                 END IF
  262.         END IF
  263. END PROCEDURE
  264.  
  265. PROCEDURE CheckPreviousNumberOfFootnotes
  266.         SET currentFrameName TO FrameName
  267.         SET SelectedFrame TO "footnote data"
  268.         CursorHome
  269.         SearchClear
  270.         SET SearchSearch1 TO "0"
  271.         SET SearchWholeWords1 TO TRUE
  272.         SearchForward
  273.         SET x TO TableCurrentRow
  274.         SET previousFootnoteCount TO x
  275.         SET SelectedFrame TO currentFrameName
  276.         SET x TO 1
  277.         REPEAT
  278.                 IF AttributeUnbreakable THEN
  279.                         SET x TO x - 1
  280.                 ELSE
  281.                 END IF
  282.                 ParagraphDown
  283.                 EXIT WHEN EndOfFrame
  284.                 SET x TO x + 1
  285.                 SET currentFootnoteCount TO x
  286.         END REPEAT
  287.         SET addedFootnotes TO currentFootnoteCount - previousFootnoteCount
  288.         IF addedFootnotes = 0 THEN
  289.         ELSE
  290.                 IF addedFootnotes =1 THEN
  291.                         MSG "You have added one footnote. You should skip the Initial Check phase"
  292.                 ELSE
  293.                 END IF
  294.                 IF addedFootnotes =2 THEN
  295.                         MSG "You have added two footnotes. You should skip the Initial Check phase"
  296.                 ELSE
  297.                 END IF
  298.                 IF addedFootnotes =3 THEN
  299.                         MSG "You have added three footnotes. You should skip the Initial Check phase"
  300.                 ELSE
  301.                 END IF
  302.                 IF addedFootnotes =4 THEN
  303.                         MSG "You have added four footnotes You should skip the Initial Check phase"
  304.                 ELSE
  305.                 END IF
  306.                 IF addedFootnotes =5 THEN
  307.                         MSG "You have added five footnotes. You should skip the Initial Check phase"
  308.                 ELSE
  309.                 END IF
  310.                 IF addedFootnotes >5 THEN
  311.                         MSG "You have added more than five footnotes. You should skip the Initial Check phase"
  312.                 ELSE
  313.                 END IF
  314.         END IF
  315.         IF addedFootnotes = 0 THEN
  316.         ELSE
  317.                 IF addedFootnotes < 0 THEN
  318.                         SET addedFootnotes TO 0 - addedFootnotes
  319.                         IF addedFootnotes = 1 THEN
  320.                                 MSG "You have deleted one footnote. You should skip the Initial Check Phase when you 'Create Footnotes'"
  321.                         ELSE
  322.                         END IF
  323.                         IF addedFootnotes = 2 THEN
  324.                                 MSG "You have deleted two footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  325.                         ELSE
  326.                         END IF
  327.                         IF addedFootnotes = 3 THEN
  328.                                 MSG "You have deleted three footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  329.                         ELSE
  330.                         END IF
  331.                         IF addedFootnotes = 4 THEN
  332.                                 MSG "You have deleted four footnotes You should skip the Initial Check Phase when you 'Create Footnotes'"
  333.                         ELSE
  334.                         END IF
  335.                         IF addedFootnotes = 5 THEN
  336.                                 MSG "You have deleted five footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  337.                         ELSE
  338.                         END IF
  339.                         IF addedFootnotes > 5 THEN
  340.                                 MSG "You have deleted more than five footnotes. You should skip the Initial Check Phase when you 'Create Footnotes'"
  341.                         ELSE
  342.                         END IF
  343.                 ELSE
  344.                 END IF
  345.         END IF
  346.         QUERY  "Do Initial Check?  (Click YES)   To skip this test choose No " TO message
  347.         IF message  THEN
  348.                 IF addedFootnotes > 0 THEN
  349.                         MSG "In the future you should skip this phase when you have added  any footnotes!"
  350.                 ELSE
  351.                 END IF  
  352.                 IF addedFootnotes < 0 THEN
  353.                         MSG "In the future you should skip this phase when you have deleted any footnotes!"
  354.                 ELSE
  355.                 END IF
  356.                 CALL CheckIfOnSamePageInitial
  357.         ELSE
  358.         END IF
  359. END PROCEDURE
  360.  
  361. PROCEDURE CreateFootnoteData
  362.         SET currentFrameName TO FrameName
  363.         FrameCreateStart
  364.         SET FrameStartingPage TO CursorPageNumber
  365.         SET FrameName TO "footnote data"
  366.         SET FrameRightPageMarginRight TO 2
  367.         SET FrameRightPageMarginTop TO 1
  368.         SET FrameRightPageMarginLeft TO 2
  369.         SET FrameRightPageMarginBottom TO 1
  370.         SET FrameShouldDraw TO FALSE
  371.         SET FrameShouldPrint TO FALSE
  372.         SET FrameOpaque TO FALSE
  373.         FrameProcessChanges
  374.         TableCreateStart
  375.         SET TableRows TO 1
  376.         SET TableColumns TO 5
  377.         DefineToDocumentEnd
  378.         StyleCreateVariation
  379.         AlignCentered
  380.         StyleApplyVariation
  381.         CancelDefinedBlock
  382.         TableProcessChanges
  383.         CursorHome
  384.         CreateLinkTag "footnote data"
  385.         SET SelectedFrame TO currentFrameName
  386. END PROCEDURE
  387.  
  388. PROCEDURE GetDirections
  389.         SET lors TO " "
  390.         MSG misplacedMessage
  391.         GET "Select Cancel if to fix this manually, or choose to adjust  (s)pacing or adjust (l)eading?" TOSTRING adjustMessage
  392.         IF adjustMessage = "l" THEN
  393.                 GET "Increase Leading (+)  Decrease Leading (-)" TOSTRING upDownMessage
  394.                 IF upDownMessage = "+" THEN
  395.                         GET "How many points?" TOVALUE leadingIncrement
  396.                         GET " I will increase the leading in each footnote. How many times should I try?" TOVALUE count
  397.                         IF count = 0 THEN
  398.                                 SET count TO 2
  399.                         ELSE
  400.                                 SET count TO count + 1
  401.                         END IF
  402.                 ELSE
  403.                         IF upDownMessage = "-" THEN
  404.                                 GET "How many points?" TOVALUE leadingIncrement
  405.                                 GET " I will decrease the leading in each footnote. How many times should I try?" TOVALUE count
  406.                                 IF count = 0 THEN
  407.                                         SET count TO 2
  408.                                 ELSE
  409.                                         SET count TO count + 1
  410.                                 END IF
  411.                         ELSE
  412.                                 SET StatusMessage TO "Proceed with the manual changes needed.....Good luck"
  413.                                 Pause 5
  414.                                         !       MSG "Proceed with the manual changes necessary."
  415.                                         SET c TO "manual end"
  416.                         END IF
  417.                 END IF                 
  418.         ELSE
  419.                 SET lors TO "l"
  420.         END IF
  421.         IF adjustMessage = "s" THEN
  422.                 GET "How many points should the spacing be increased?" TOVALUE spacingIncrement
  423.                 GET "I will increase the spacing between each footnote. How many times should I try?" TOVALUE count
  424.                 IF count = 0 THEN
  425.                         SET count TO 2
  426.                 ELSE
  427.                         SET count TO count + 1
  428.                 END IF
  429.         ELSE
  430.                 SET lors TO lors + "s"
  431.         END IF
  432. END PROCEDURE
  433.  
  434.  
  435. MACRO MasterFootnote
  436.         CancelDefinedBlock        ! This is important, nasty things happen if you happen to have some text selected!
  437.         GoToLinkTag "startpoint"
  438.         CursorUp
  439.         IF AttributeUnderline THEN
  440.         ELSE
  441.                 PUT "*"
  442.         END IF
  443.         GoToLinkTag "startpoint"
  444.         QUERY "You are about to convert to Footnotes.  All previous manual tweaking of footnotes will be lost! OK to proceed?" TO a
  445.         IF a  THEN
  446.         ELSE
  447.                 MSG "Canceling..... Back to Document"
  448.                 QUIT
  449.         END IF
  450.         IF NOT IsCharNumeric THEN
  451.                 MSG "Please make sure the cursor is right before the number of the first endnote. Try again!"
  452.                 QUIT
  453.         ELSE
  454.         END IF
  455.         SET startingFrameName TO FrameName
  456.         SET placeMarker TO CursorPosition
  457.         SET Env5 TO 4pt
  458.         ParagraphUp
  459.         IF CursorCharacter = "*" THEN
  460.                 SET Env9 TO "*"
  461.                 DefineToLineEnd
  462.                 DefineLeft
  463.                 DeleteText
  464.         ELSE
  465.                 SET Env6 TO StylePointSize
  466.                 SET Env7 TO UnderlineSize
  467.                 SET Env8 TO UnderlinePosition
  468.                 DefineToParagraphEnd
  469.                 CopyToClipboard
  470.                 SET Env9 TO PastedClipboard
  471.                 CancelDefinedBlock
  472.         END IF
  473.         SET CursorPosition TO placeMarker
  474.         SET Env0 TO 0pt
  475.         SET leadPoints TO 0pt
  476.         SET spacePoints TO 0pt
  477.         SET CursorPosition TO placeMarker
  478.         SET LinkTagName TO "footnote data"
  479.         IF LinkTagExists THEN
  480.                 CALL  CheckPreviousNumberOfFootnotes
  481.         ELSE
  482.         END IF
  483.         SET CursorPosition TO placeMarker 
  484.         IF DocPrefShowStatus THEN
  485.                 SET preserveStatus TO "visible"
  486.         ELSE
  487.                 SET preserveStatus TO "not visible"
  488.                 SET DocPrefShowStatus TO TRUE
  489.         END IF        
  490.         IF IsStylePaletteVisible THEN
  491.                 SET preserveStylePalette TO "visible"
  492.         ELSE
  493.                 SET preserveStylePalette TO "not visible"
  494.                 StylePaletteVisible
  495.         END IF
  496.         SET forceFootnoteRedo TO "off"
  497.         SET nothingToDo TO "off"
  498.         SET c TO "automatic repeat"
  499.         SET currentFrameName TO SelectedFrame
  500.         SET count TO 1
  501.         SET Env1 TO "null"
  502.         SET upDownMessage TO " "
  503.         SET adjustMessage TO " "
  504.         SET loopCount TO 0
  505.                         !The following REPEAT is run only once, except it is repeated if you decide to correct  for misplaced footnote frames.
  506.         REPEAT                                          !<<<<<<<<<<<<<<<<<<<<<<<<<<<repeat<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  507.                                 !This is the macro that starts the footnote creation process. First though we have to put the cursor at  the 
  508.                                 ! beginning of the  first endnote, right before the number.
  509.                 SET loopCount TO loopCount + 1
  510.                 SET SelectedFrame TO startingFrameName
  511.                 CancelDefinedBlock
  512.                 GoToLinkTag "startpoint"
  513.                 REPEAT
  514.                         IF AttributeUnbreakable THEN
  515.                                 ParagraphDown
  516.                         ELSE
  517.                                 EXIT
  518.                         END IF
  519.                 END REPEAT
  520.                 IF EndOfFrame THEN 
  521.                 SET LinkTagName TO "footnote data"
  522.                         IF LinkTagExists THEN
  523.                                 CALL DeleteFootnoteFrames
  524.                                 SET nothingToDo TO "on"
  525.                                 CALL QuitMacro
  526.                         ELSE
  527.                         END IF
  528.                 ELSE
  529.                 END IF
  530.                 REPEAT
  531.                         SET placeMarker TO CursorPosition 
  532.                         CursorWordRight
  533.                         PUT " "
  534.                         CursorWordLeft
  535.                         SET readCharAtCursor TO CursorCharacter
  536.                         REPEAT
  537.                                 IF readCharAtCursor = " " THEN
  538.                                         EXIT
  539.                                 ELSE
  540.                                         DefineRight
  541.                                         SET readCharAtCursor TO CursorCharacter
  542.                                 END IF
  543.                         END REPEAT
  544.                         CopyToClipboard
  545.                         CancelDefinedBlock
  546.                         DeleteText
  547.                         SET footnoteNumber TO PastedClipboard
  548.                         SET CursorPosition TO placeMarker
  549.                         EndNoteJump
  550.                         SET b TO CursorPageNumber
  551.                         CONVERT b TOSTRING b
  552.                         SET b TO footnoteNumber + b
  553.                         SET LinkTagName TO b
  554.                         IF LinkTagExists THEN
  555.                                 CALL DeleteFootnoteFrames
  556.                                 EXIT
  557.                         ELSE
  558.                                 SET CursorPosition TO placeMarker
  559.                                 ParagraphDown
  560.                         END IF
  561.                         EXIT WHEN EndOfFrame
  562.                 END REPEAT
  563.                 IF forceFootnoteRedo = "on" THEN
  564.                         CALL DeleteFootnoteFrames
  565.                 ELSE
  566.                 END IF
  567.                 SET SelectedFrame TO startingFrameName
  568.                 SET currentFrameName TO FrameName
  569.                 SET CursorPosition TO placeMarker
  570.                 SET LinkTagName TO "footnote data"
  571.                 IF LinkTagExists THEN
  572.                 ELSE
  573.                         CALL  CreateFootnoteData
  574.                 END IF
  575.                 SET SelectedFrame TO currentFrameName
  576.                 GoToLinkTag "startpoint"
  577.                 ! This REPEAT is the one that steps through the endnote text block, converting them to footnotes.
  578.                 REPEAT                                  !<<<<<<<<<<<<<<<<<<<<repeat<<<<<<<<<<<<<<<<<<<<<<<<<
  579.                 ! SaveDocument   ! this is optional, but could be a good thing to do if you run the macros repeatedly
  580.                                                           ! because the Snapshot file can possibly get very large and you can run out of disk
  581.                                                           ! space, causing much grief and swearing and cussing.
  582.                                                           ! MAKE A BACKUP BEFORE DOING FOOTNOTES!
  583.                         REPEAT
  584.                                 IF AttributeUnbreakable THEN
  585.                                         ParagraphDown
  586.                                 ELSE
  587.                                         EXIT
  588.                                 END IF
  589.                         END REPEAT
  590.                         IF EndOfFrame THEN
  591.                                 SET StatusMessage TO "Finished processing last footnote....."
  592.                                 EXIT
  593.                         ELSE
  594.                                 SET StatusMessage TO "Processing footnotes......."
  595.                                 SET describeSubdir TO ProgramDirectory
  596.                                 SET macroSubdir TO describeSubdir + "macros\"
  597.                                 SET footnotePath TO macroSubdir + "footnote"
  598.                                 PlayMacro footnotePath
  599.                                 CursorWordLeft
  600.                                 EndnoteJump
  601.                                 ParagraphDown
  602.                                 CancelDefinedBlock
  603.                         END IF
  604.                 END REPEAT                              !>>>>>>>>>>>>>>>>>>>>>repeat>>>>>>>>>>>>>>>>>>>>>>>>
  605.         SET StatusMessage TO "Done......." 
  606.         SET holdFrameName TO FrameName
  607.         SET SelectedFrame TO "footnote data"
  608.         CancelDefinedBlock
  609.         DefineToDocumentEnd
  610.         DeleteText
  611.         CancelDefinedBlock
  612.         PUT "0"
  613.         TableCellTab
  614.         PUT "0"
  615.         TableCellTab
  616.         PUT "0"
  617.         TableCellTab
  618.         PUT "0"
  619.         TableCellTab
  620.         PUT "0"
  621.         CursorHome
  622.         SET SelectedFrame TO holdFrameName
  623.         CALL CheckIfOnSamePage
  624.         IF Env1 = "retry" THEN
  625.                 IF count = 1 THEN
  626.                         CALL GetDirections
  627.                         IF lors = "ls" THEN
  628.                                 MSG "You must enter a lower case  's'  or a 'l' in order to proceed with automatic error correction"  
  629.                                 CALL GetDirections
  630.                                 IF lors = "ls" THEN
  631.                                         SET c TO "manual end"
  632.                                 ELSE
  633.                                 END IF 
  634.                         ELSE
  635.                         END IF
  636.                 ELSE
  637.                 END IF
  638.                 SET count TO count - 1
  639.                 IF adjustMessage = "l" THEN
  640.                         IF upDownMessage = "+" THEN
  641.                                 SET v TO leadingIncrement
  642.                                 REPEAT
  643.                                         SET leadPoints TO leadPoints + 1pt
  644.                                         SET v TO v - 1
  645.                                         EXIT WHEN v = 0
  646.                                 END REPEAT
  647.                                 SET Env0 TO Env0 - leadPoints
  648.                         ELSE
  649.                         END IF
  650.                         IF upDownMessage = "-" THEN
  651.                                 SET v TO leadingIncrement
  652.                                 REPEAT
  653.                                         SET leadPoints TO leadPoints + 1pt
  654.                                         SET v TO v - 1
  655.                                         EXIT WHEN v = 0
  656.                                 END REPEAT
  657.                                 SET Env0 TO Env0 + leadPoints
  658.                         ELSE
  659.                         END IF
  660.                 ELSE
  661.                         IF adjustMessage = "s" THEN
  662.                                 SET v TO spacingIncrement
  663.                                 REPEAT
  664.                                         SET spacePoints TO spacePoints + 1pt
  665.                                         IF v = 0 THEN
  666.                                         ELSE
  667.                                         SET v TO v - 1
  668.                                         END IF
  669.                                         EXIT WHEN v = 0
  670.                                 END REPEAT
  671.                                 SET Env5 TO Env5 + spacePoints
  672.                         ELSE
  673.                         END IF
  674.                 END IF
  675.         ELSE
  676.         END IF
  677.         EXIT WHEN count <= 0
  678.         EXIT WHEN Env1 = "null"
  679.         IF c = "manual end" THEN
  680.                 CALL QuitMacro
  681.         ELSE
  682.         END IF
  683.         END REPEAT                                  !>>>>>>>>>>>>>>>>>>>>>>repeat>>>>>>>>>>>>>>>>>>>>>>>>
  684.         SET StatusMessage TO "All footnotes have been created"
  685.         IF c =  "manual end" THEN
  686.                 CALL QuitMacro
  687.         ELSE
  688.         END IF
  689. CALL QuitMacro
  690. END MACRO
  691.  
  692.