Markdown / FoldingText scripts for DT ?

Found myself scribbling a couple of Applescript lines to copy selected bookmarks as MD text, this morning, and suspecting that I was probably reinventing the wheel.

Where have others got to with DT MD FT scripts ?

FWIW, this morning’s lines were:

set str to ""
tell application id "DNtp"
	repeat with oRec in (selection as list)
		tell oRec to if its kind = "BookMark" then set str to str & "- [" & its name & "](" & its URL & ")" & linefeed
	end repeat
end tell

set the clipboard to str

You might recall this earlier exchange

I’ve also made a Keyboard Maestro palette whose commands execute various scripts that grab a link to the current note in Evernote, or a link to the current message in Mail, or link to the current document in DEVONthink as a MD link (with three flavors for this DEVONthink script: make the link an image link, or make the link open the document in the file system, or make the link open the document in DEVONthink). A final command in that palette makes an entry in DayOne with a link-back to the current selection in DEVONthink. Along the lines of the latter, I’ve begun to work with scripting for the jrnl CLI which offers more choices than the DayOne CLI.

None of this is FT of course, but MD is MD. I’ve migrated to doing nearly all my writing with MMD – and all of that with Sublime Text 2 + Marked for preview and output. (Drafts, Nebulous, and Writing Kit on iOS.) FT is too narrowly focused and special-purpose, IMO, and MMD Composer 2’s design is strange and fussy. Ulysses 3 might be interesting someday.

Thanks for mentioning jrnl as an alternative to the DayOne CLI.

My own work-flow happens to be built on outlining and scripted access to outlines, so FT is a tool which I reach for constantly, but I often switch into Sublime Text for regular expressions etc. (A joy of text, of course, is working with two or three different apps on the same file).

That’s a good point, and the work you have done with FT scripting is excellent. I’ve been working with Pattern Digger recently, which is gradually maturing to be an interesting niche tool for extracting keyworded lines from text files – esp. longer ones. For developers, I could see workflow that uses Pattern Digger to simultaneously extract all of a particular kind of comment (i.e., “fix me”) from all the source for a project, and then feed that text to FT.