It's intended for use with email. If you just copy a script, and then paste it into a text window like an email client's, you'll get the curly braces and semicolons that make it hard to read. This script avoids that problem, and it's very fast.
try
case typeOf (window.frontMost ()^)
outlineType
menubarType
scriptType
oldTarget = target.set (window.frontMost ())
else
return (false)
else
return (false)
op.setDisplay (false)
local (oldCursor = op.getCursor (), indent = 2)
op.firstSummit ()
op.fullExpand ()
on add (s)
txt = txt + string.filledString (' ', (op.level () - 1) * indent) + s + cr
loop
add (op.getLineText ())
if not op.go (flatdown, 1) {break}
clipboard.putvalue (txt)
op.setCursor (oldCursor)
op.setDisplay (true)
target.set (oldTarget)