Script to convert OO to markdown, tex, and PDF using pandoc

@dmigrant:

Here’s a working example in AppleScript, based on a script posted by Rob Trew.

-- marks up strong and emphasis in topic of a single selected OO row

tell application "OmniOutliner"
	tell front document
		tell first selected row
			tell its topic's attribute runs
				set {lstText, lstFont} to {its text, its font}
			end tell
		end tell
	end tell
end tell
--return {lstText, lstFont}

set outTxt to ""
repeat with i from 1 to lstText's length
	set {aChunk, aFont} to {lstText's item i, lstFont's item i}
	if aFont contains "bold" or aFont contains "black" then
		set outTxt to outTxt & "**" & aChunk & "** "
	else if lstFont's item i contains "italic" then
		set outTxt to outTxt & "*" & aChunk & "*"
	else
		set outTxt to outTxt & aChunk
	end if
end repeat
return outTxt

SG