Extract Text from document and append spotlight comments

Hi,
I am trying to create a workflow where I open a document in TextEdit, extract a line or two of text, and append that text to the spotlight metadata. The one workflow I have tried and failed with is:

  1. Ask finder for files
  2. Open finder items in TextEdit
    3)Filter text Paragraphs that begin with
  3. Append to spotlight

There are a couple of problems with this, first the Append Spotlight function doesn’t appear to accept text.

Second, I am having troulbe with filtering the text. Even in my fake .txt files to test this I can’t get it to work. I am thinking about swtiching to running grep via apple script instead.

If anyone has any suggestions on this I would really appreciate it.

Thanks!