After reading this hint on macosxhints about how to create an audio file from text, I figured the process could probably be streamlined a bit. So, I created a Service (that appears in the Services menu) that operates on selected text. Select the plain text in your source location (text file, web page, email, etc.) and then select Services » Speak to iTunes Audiobook to speak the text into a track that will appear in the Audiobooks section of iTunes. Just remember to set the encoder quality beforehand in iTunes, because it's not configurable through AppleScript (I recommend using 'Spoken podcast').
Package download [40KB]
For those curious few, the AppleScript within the service is as follows:
on process(input)
set theOriginalPath to (path to desktop folder as string) & "Speech.aiff"
-- Speak text
say input using "Alex" saving to theOriginalPath
tell application "iTunes"
-- Import AIFF audio
set theOriginaliTunesFile to (add theOriginalPath)
tell application "Finder" to delete theOriginalPath
-- Prepare AAC encoder
set lastEncoder to current encoder
set newEncoder to (item 1 of (every encoder whose format is "AAC"))
set current encoder to newEncoder
-- Convert to AAC
set theM4aFile to item 1 of (convert theOriginaliTunesFile)
set current encoder to lastEncoder
-- Remove original
delete theOriginaliTunesFile
set fileLocation to location of theM4aFile
-- Set as audio book type
tell application "Finder"
set theFile to fileLocation as alias
set file type of theFile to "M4B "
if name extension of theFile is not "m4b" then
set name of theFile to ((text 1 thru -((length of (get name extension of theFile)) + 1) of (name of theFile as text)) & "m4b") as string
end if
end tell
-- Remove from iTunes, and re-add
delete theM4aFile
set theNewTrack to add theFile
-- Select in iTunes
reveal theNewTrack
end tell
end processMac OS X Hints
http://hints.macworld.com/article.php?story=2008050623341520