[I would have "replied" to the existing thread on this topic, but the
"reply" link is missing for it in the web interface.]

[Long-time BBEdit user here -- since 4.0; I haven't been on the
mailing list in a coon's age, though.]

In response to Lukas Mathis's request, Steve Kalkwarf posted an
AppleScript designed to be used as a Service, which would perform
BBEdit's splendid "rewrap quoted text" function on passed text.

I wanted to create a version of the script that would wrap to 68
characters instead of 72, automatically "fill" paragraphs, eliminate
the spaces that might exist between quotation indicators, and add one
space after the last indicator, thus:

>> > Some
> > > terribly quoted text that most pieces of software
>> > couldn't wrap sensibly if they tried.

>>> Some terribly quoted text that most pieces of software couldn't
>>> wrap sensibly if they tried.

Here's what I have:

on run {input, parameters}
        tell application "BBEdit"
                set wasVisible to visible of scratchpad window
                set contents of scratchpad window to input
                set w to open scratchpad window
                rewrap quoted text w width 68 with paragraph fill and removing 
quote
spaces and leaving trailing quote spaces
                if not wasVisible then close w
                return contents of scratchpad window
        end tell
end run

My problem, though is with the "leaving trailing quote spaces" phrase,
which causes the AppleScript Editor compiler to tell me that it
"Expected end of line, etc. but found identifier" -- that is,
"trailing." It seems to accept "leaving," but I think that *it* thinks
that "leaving" is somehow signifying something else. Perhaps it's now
a reserved word?

This is with AppleScript 2.1.2 running on OS X 10.6.7.

Any ideas? (Of course, this would all be much simpler if "rewrap
quoted text" were available as a Text Factory -- but for some reason
it is not.)

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to