How to turn finder comments into markdown?

I use webclipping into DT alot. I try to convert the weblink to markdown and then save this markdown file in folders for read articles (I got two: one for links without my own summary, the other for links where I wrote a summary).

The DT webclipper offers this COMMENT field, where one could actually write a lot down and still read the to be clipped website and scroll it. So I could basically write my summary in the webclipper comment section, you know?

Now how can I most easily get this “finder comment” read out and written into the markdown document of the clipped webpage? I’d like to be able to do either one of these:

  • I want to extract the text in finder comment into the start of the markdown document of the webpage (using some easy formatting to separate it from the original text)
  • OR extract the finder comment, put it into a markdown document of its own (using a certain template) but include a markdown link to the original webclipped markdown document, maybe like this:

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Noted from [Title of Webclip](link to webclip in DT):

(text from finder comment)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

How can I achieve this?

Since I’m a script person, I’d suggest a script to do that. There might be other ways, though. Quite often, @cgrunenberg comes up with some ingenious method that’s far simpler than scripting.

Yeah, well, I’m not the biggest scripter this side of Jupiter, but anyway I came up with this:

tell application id "com.devon-technologies.think3"

    set theItem to (the first item of (the selection as list))
    set the clipboard to "Entnommen aus [" & name of theItem & "](" & reference URL of theItem & "):
   " & comment of theItem
   ( paste clipboard )

end tell

You have to modify the plain text property of the record. Which is no fun with AppleScript, but feasible. The clipboard is not needed at all for that.

tell application id "DNtp" is recommended instead to ensure compatibility to future releases.

As smart rules can’t change contents, in this case a script is the only option :slight_smile:

Current version:

tell application id "DNtp"
    set theItem to (the first item of (the selection as list))
    set theText to comment of theItem

    if length of theText > 0 then
        set the clipboard to "Entnommen aus [" & name of theItem & "](" & reference URL of theItem & "):

        " & theText
    else
        display dialog "Da gab's keinen Kommentar"
    end if
    (* paste clipboard *)
end tell

OK, I will do that later. First I now run the script and afterwards copy from the clipboard to right where I need this text.