KeyNote: Export text content as TexEdit document.

KeyNote has the functionality to export its presentations to various formats. Only not as TextEdit document. Perhaps the following script will be useful to someone. Or, maybe not…


set theText to ""

tell application "Keynote"
	set theSlides to slides of document 1
	repeat with theSlide in theSlides
		tell (contents of theSlide)
			set theText to theText & "   Slide " & slide number & return & "=========" & return & "   Title" & return
			tell default title item to set theText to theText & its object text & return & "   Body" & return
			tell default body item to set theText to theText & its object text & return & "   Presenter Notes" & return
			set theText to theText & its presenter notes & return & return
		end tell
	end repeat
end tell

tell application "TextEdit"
	activate
	make new document with properties {name:"Extracted Text of Keynote presentation", text:theText}
end tell