I can't get OmniOutliner to export a text file

Here’s hoping that you still have at least some of your hair. I know this is late to the party but there is a better way and I dislike unanswered questions that are pretty core (like exporting a doc).

I’ve included three of the export document types.

Hope this helps,
Ken

tell application "OmniOutliner"
	
	--Export to the desktop, using the current filename (sans extension)
	set deskPath to path to desktop folder as string
	set fileN to name of document 1 as string
	
	--Combine path and filename
	set DeskSave to deskPath & fileN
	
	--As export only affects visible text, expand all so that entire doc is exported
	expandAll
	
	--Export as three different doc types and append the appropriate extension
	export document 1 to (DeskSave & ".opml") as "org.opml.opml"
	export document 1 to (DeskSave & ".txt") as "public.plain-text"
	export document 1 to (DeskSave & ".rtf") as "public.rtf"
	
end tell