file://Name_of_the_file#Endnote_number.
This is the file I downloaded: http://oll.libertyfund.org/index.php?op ... ayout=html
I wish to print the file, but that implies modifying it so these "Endnotes" become footnotes (anything else would make them completely useless). Of course, I could do it manually, but there are more than 250 of these, so I'd rather avoid it.
I already converted the file into an ODT document.
The notes themselve have the following structure:
[reference] body of the note \n - I think it's \n. It's the unprintable character that looks somewhat like Pi (π). There may be one or more carriage return in the body of an endnote.
The manual convertion process is such:
1. In the text body, CTRL+Left click on a ("endnote") link to go to the endnote itself (the link is either associated with an uppercase number or, most of the time, with one or more words in the text)
2. Select the body of the note, between the right bracket ] and the \n. Either copy or cut it.
3. Go back to the appropriate spot in the main body, using the link associated with [reference].
4. Use the Insert -> Footnotes command and paste in the appropriate spot after confirmation.
5. Repeat with the next link/note.
I did try to make a macro with the recording tool. Here is its code:
Code: Select all
REM ***** BASIC *****
Sub Main
End Sub
sub Convert_Footnote
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Bookmark"
args1(0).Value = "lf1292_footnote_nt_037"
dispatcher.executeDispatch(document, ".uno:JumpToMark", "", 0, args1())
rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:Open", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:GoToNextWord", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:GoToNextWord", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:GoToNextWord", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:WordRightSel", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Cut", "", 0, Array())
rem ----------------------------------------------------------------------
dim args20(0) as new com.sun.star.beans.PropertyValue
args20(0).Name = "Bookmark"
args20(0).Value = "c_lf1292_footnote_nt_037"
dispatcher.executeDispatch(document, ".uno:JumpToMark", "", 0, args20())
rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:Open", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertFootnote", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
end sub
- Dynamically takes the link for any endnote instead of only using the one I used to make the macro.
- Select by itself between the ] and the \n.
- Loops so the macra needs only to be used once for the entire file.
I have no idea how to do any of the above.
Help?