Export Perspective Task to Markdown

I need a way to export the tasks of a given perspective to Markdown with notes included.

I am using the Desktop versions of OF. Thanks in advance for any direction you can give me.

I tried finding a script that does this already but my google skills are lacking on this subject.

Have you tried copy/pasting from OF to an editor? It will give you Taskpaper syntax.

(Tho without including the notes mentioned by the OP, I think).

I actually tried a single task with this result (including the note):

- Export to Markdown @parallel(true) @autodone(false) @context(WaitingFor) @tags(WaitingFor) @due(2020-05-22 20:00) @defer(2020-05-21 00:00)
	This is the text of the note

And this is all tasks from a Project perspective (open perspective, select all (Cmd-A), right click, copy as task paper):

- (null)
	- Diversen @parallel(true) @autodone(false)
		Taken zonder project worden hier automatisch toegevoegd

		- Terughalen Omnifocus Archive van een paar weken terug van Time Machine Backup @parallel(true) @autodone(false)
			link <file:///Users/robert/Library/Containers/com.omnigroup.OmniFocus3/Data/Library/Application%20Support/OmniFocus/>

		- Inplannen afspraak Squash @parallel(true) @autodone(false) @defer(2020-06-01 00:00)

		- Kopen nieuwe fietshelm @parallel(true) @autodone(false) @context(Plaatsen : Boodschap) @tags(Plaatsen : Boodschap)
		- Export to Markdown @parallel(true) @autodone(false) @context(Mensen : Wachten) @tags(Mensen : Wachten) @due(2020-05-22 20:00) @defer(2020-05-21 00:00)
			This is the text of the note

1 Like

BTW, a good search in these forums for ‘markdown export’ in the OmniFocus category, would have led you to this thread:

Got it. On this system and version, plain Edit > Copy is missing the notes, but Edit > Copy as TaskPaper is harvesting them.

Might this help?

tell application "OmniFocus"
	tell front window
		set my_trees to selected trees of content
		set my_selection to value of item 1 of my_trees
		set task_name to name of my_selection
		set task_note to note of my_selection
		set project_name to name of parent task of my_selection
		set selection_id to id of my_selection
		set selection_url to "omnifocus:///task/" & selection_id
		return "- task_name: " & task_name & "
" & ¬
			"- task_project: " & project_name & "
" & ¬
			"- task_url: " & selection_url & "
" & ¬
			"- task_note: " & task_note
	end tell
end tell

Thanks everyone for all your insights. While Task Paper is an option my use case was to quickly process a perspective to MD and then export to an email. Thanks for everyone’s help.

Thx @sam70, very useful to me!


1 Like