Title: SCRIPT to Open custom views
I find opening the Custom Views from the Folder List to be a pain. For one thing, if the CV folder is open, none of my mail folders are visible! So I wrote a little script that throws up a sorted list of the available Custom Views and lets me click on the one I want. I can leave the CV folder in the Folder List closed. This gives me faster access. I give it the keyboard shortcut of Command-Control-V by adding “\mcV” to its file name. Here it is:

--- Open Custom View \mcV---
--- Script by Allen Watson for Entourage, 10/21/2000
tell application "Microsoft Entourage"
    set viewList to name of every custom view
    set viewList to my sortList(viewList)
    set CV to choose from list viewList with prompt "Choose a custom view to open, or press Cancel to cancel" without multiple selections allowed
    try
        if not CV then return
    end try
    set CV to CV as string
    if CV is "" then
        error "No custom view selected."
        return
    end if
    open custom view CV
end tell

on sortList(l)
    set testClass to class of item 1 of l
    repeat with j from 1 to count l
        if class of (item j of l) is not testClass then
            error "Cannot sort lists of mixed class."
            error 128
        end if
    end repeat
    if length of l � 1 then return l
    set x to item 1 of l
    set ll to rest of l
    set l1 to {}
    set l2 to {}
    repeat with i in ll
        if x < i then
            set l2 to l2 & i
        else
            set l1 to l1 & i
        end if
    end repeat
    if length of l1 > 1 then set l1 to sortList(l1)
    if length of l2 > 1 then set l2 to sortList(l2)
    return l1 & x & l2
end sortList
--- End of script ---
--
Peace be with you!
Allen <[EMAIL PROTECTED]> XNS Name: =Allen Watson
My web page: <http://home.earthlink.net/~allenwatson/>

Reply via email to