set theString to textView's |string|() as text
set thePars to paragraphs of theString
set allLocations to {0}
repeat with aPar in thePars
set end of allLocations to (item -1 of allLocations) + (length of aPar) + 1
if (count of allLocations) = 10 then exit repeat
end repeat
set theStart to item 2 of allLocations
set theEnd to item 10 of allLocations
set theRange to {theStart - 1, theEnd - theStart}
textStorage's deleteCharactersInRange_(theRange)
set theString to textView's |string|()
set theLength to theString's |length|()
set searchLength to theLength
set searchStart to 0
set allLocations to {}
repeat 9 times
set {aLocation, aLength} to theString's rangeOfString_options_range_(linefeed, 0, {location:searchStart, |length|:searchLength}) as list -- find first instance
if aLength = 0 then exit repeat -- length of 0 means it wasn't found
set end of allLocations to aLocation
set searchStart to aLocation + 1 -- restrict search to after found instance
set searchLength to theLength - aLocation - 1
end repeat
set theStart to item 1 of allLocations
set theEnd to item 9 of allLocations
set theRange to {theStart, theEnd - theStart}
textStorage's deleteCharactersInRange_(theRange)
The first is probably a tad quicker, not that you'll notice.