Title: Re: Where is Allen's Number Paragraphs script?
Man, that is one slick little script, Allen. I’m a fast typer, but I’ve never been good at the numbers.

Some other nice features of this:

1. -- no need to have HTML on in order to number a list.

2. -- With HTML on or off, you can now put a blank paragraph between sentences. You can actually place as many blank paragraphs as you want, and still the numbers will show up accurately with Allen’s script. You can even mix and match, with no blanks between some paragraphs, and six between another.

3. -- the Numbering function in the HTML email toolbar was always difficult to use whenever you needed to go back and edit some of the numbered paragraphs.

4. -- this is probably the best magical part: if you go back and severely edit a set of paragraphs that were numbered (remove a couple of the 2., 5., etc), mucked around with the paragraph spacings, etc. , you can just highlight the whole bunch again, run the Number Paragraphs script again, and voilà, the whole thing removes all the former numberings,  and replaces them with new correct ones.

You guys should have your own version of the Oscars, or the Webbies, called the Scripties, where end users vote in for different categories at each year end Academy:  Best Overall Actually Useful Scripts That I Use Every Day, Best Supporting Script, Scripts that Make Me Clap Out Loud, Most Technically Advanced Scripts, Best Looking Female Scripter, etc.

 


On 5/18/04 1:51 AM, "Entourage:mac Talk" <[EMAIL PROTECTED]> wrote:

From: Barry Wainwright <[EMAIL PROTECTED]>
Date: Tue, 18 May 2004 07:41:28 +0100
Subject: 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>


Reply via email to