Apple Script to get the H1 in a Markdown file as String

paragraph 1 did the trick! Thanks a lot.

For anyone interested in the resulting solution you can check out both the Applescript and the Javascript solutions in the original topic: