tagging parts of text

I have a very long PDF dictionary document, arranged with each entry as a separate paragraph and the headword in bold. There is a footnote at the bottom of each page.

Can I write a script (after coverting it to text) and tag the entries with xml, like this:

headwordentry text

with a view to being able to search only by headword?


Once you have text, you can script TextEdit to find and replace rather nicely. This thread:


has some information as well as another link in one of the messages to another thread that covers using AppleScript to execute search and replace in TextEdit.

As long as you are somewhat comfortable with either AppleScript or Automator, this should get you moving in the right direction. If you have difficulties, please return with some code to this thread, post the code, and a whole group of folks will be ready to help you out.