On 25/11/06 08:24, "John Blagden •" <[EMAIL PROTECTED]> wrote:

> Due to a promotional campaign I was working late, and in my befuddled state
> accidentally deleted a Group.  At this point I'd have to say that the
> interface on Entourage concerning deletion of Groups is pretty diabolical.
> 
> This was not too serious as this particular group only had about 200 names
> in it, and I was able to recreate it without too much trouble.  However, I
> don't want to do it again, especially as some of my Groups have nearly a
> thousand entries.
> 
> 1. Is there a way to easily recover a deleted Group?

No

> 2. Is there anyway to 'lock' a Group to stop it being deleted?

No

> 3. Is there anyway to backup Groups easily, and make the restoration
> seamless?

The group entry is just plain text - open a group, select all and copy  to a
text file. This script will do this for you ­ putting the contents of a
selected group on the clipboard without having to open it:

-- Copy Group Entries to Clipboard v1.0
-- Barry Wainwright 22/04/2004
-- An applescript of Microsoft Entourage
-- This script will put all the entries of a selected group
-- on the clipboard as Tab-Delimited Text
-- Just select a group in the address book listing and run the script.

-- This script released under a Creative Commons Attribution, NonCommercial,
ShareAlike 2.0 England & Wales License.
-- see <http://creativecommons.org/licenses/by-nc-sa/2.0/uk/> for full
details


tell application "Microsoft Entourage"
    try
        set theGroup to item 1 of (get selection)
    on error
        display dialog "Please select a group in the address book and run
the script again" buttons {"OK"} default button 1 with icon stop
        return -99
    end try
    if class of theGroup is group then
        set exportList to {"Group: " & name of theGroup}
        set groupEntries to content of every group entry of theGroup
        repeat with anEntry in groupEntries
            copy {display name of anEntry & tab & address of anEntry} to end
of exportList
        end repeat
        set {oldDelims, AppleScript's text item delimiters} to
{AppleScript's text item delimiters, return}
        set the clipboard to exportList as text
    else
        display dialog "Please select a group in the address book and run
the script again" buttons {"OK"} default button 1 with icon stop
    end if
end tell 

Alternatively, here is another script I recently wrote to export a group's
entries to an Excel spreadsheet:

-- Export Group to Excel v1.0
-- export group entries from a selected Address Book Group to an excel
spreadsheet
-- an applescript by Barry Wainwright <mailto:[EMAIL PROTECTED]>
-- This script released under a Creative Commons Attribution, NonCommercial,
ShareAlike 2.0 England & Wales License.
-- see <http://creativecommons.org/licenses/by-nc-sa/2.0/uk/> for full
details

tell application "Microsoft Entourage"
    set theBookRef to address book 1
    try
        set theNames to name of every group of theBookRef
    on error errMsg number errNum
        display dialog "No Groups Available for this Address Book" buttons
{"Abort"} default button 1 giving up after 10
        return
    end try
    if (count theNames) > 1 then
        set theGroupName to item 1 of (get choose from list theNames ¬
            with title ¬
            "Group Selection" with prompt ¬
            "Please choose the group to export" OK button name ¬
            "Select" multiple selections allowed false ¬
            without empty selection allowed)
        set theGroup to item 1 of (get every group of theBookRef whose name
is theGroupName)
    else
        set theGroup to group 1 of theBookRef
    end if
    set theEntries to group entries of theGroup
    set resultList to {}
    repeat with anEntry in theEntries
        copy {display name of content of anEntry, address of content of
anEntry} to end of resultList
    end repeat
    set entrycount to count theEntries
end tell

tell application "Microsoft Excel"
    activate
    make new workbook
    set the view of window 1 to normal view
    set the display page breaks of the active sheet to false
    set name of active sheet to name of theGroup
    set theRows to "1:" & entrycount
    set theRange to intersect range1 (range theRows of active sheet) range2
(range "a:b" of active sheet)
    set value of theRange to resultList
    autofit theRange
end tell

-- 
Barry Wainwright

Reply via email to