Title: Re: Where is Allen's Number Paragraphs script?
It's a quick one he wrote up and sent to either this list or the Entourage:Mac list in response to a request. I'm sure he won't mind me re-posting here...
-- Script from a message sent by Allen Watson
-- on Saturday, February 21, 2004 7:47:10 pm
tell application "Microsoft Entourage"
set msg to item 1 of (get current messages)
try
set c to the selection
if class of c is not in {string, text, Unicode text} then error -1
on error
display dialog "No text selected."
return
end try
set p to paragraphs of c
set newc to ""
set n to 1 -- Separate numbering to allow unnumbered blank lines
set sigreached to false
repeat with i from 1 to (count p)
set aline to item i of p
-- Don't number blank lines or commented lines or signature lines
if aline is "-- " then set sigreached to true
if aline is not "" and aline does not start with ">" and not sigreached then
-- strip any existing number, period, or space at start of line
repeat while first character of aline is in "1234567890. "
set aline to text 2 thru -1 of aline
end repeat
set aline to "" & n & ". " & aline
set n to n + 1
set newc to newc & aline & return
else
set newc to newc & aline & return
end if
end repeat
try
set the selection to newc
on error theErr
display dialog theErr
end try
end tell
--
Barry Wainwright
Microsoft MVP (see http://mvp.support.microsoft.com for details)
Seen the Entourage FAQ pages? - Check them out:
<http://www.entourage.mvps.org/toc.html>
> From: tuqqer <[EMAIL PROTECTED]>
> Reply-To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
> Date: Mon, 17 May 2004 18:03:39 -0600
> To: Entourage mac Talk <[EMAIL PROTECTED]>
> Subject: Where is Allen's Number Paragraphs script?
>
> Where can we find Allen's "Number Paragraphs"? I checked both the
> macscripter.com as well as Allen's Mac homepage site, and couldn't locate
> it.
>
>> From: "Entourage:mac Talk" <[EMAIL PROTECTED]>
>> Date: Mon, 17 May 2004 14:18:12 -0700
>> To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
>> Subject: Entourage-Talk Digest - 05/17/04
>>
>> 3. 'Number Paragraphs': by Allen Watson (used on this message!)
>
>
> --
> To unsubscribe:
> <mailto:[EMAIL PROTECTED]>
> archives:
> <http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
> old-archive:
> <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>
>
- Where is Allen's Number Paragraphs script? tuqqer
- Re: Where is Allen's Number Paragraphs... Barry Wainwright
- Re: Where is Allen's Number Paragraphs... tuqqer
- Re: Where is Allen's Number Paragr... Barry Wainwright
- Re: Where is Allen's Number Paragr... Earl <[EMAIL PROTECTED]>
