Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An AppleScript to export Entourage emails Apps
Entourage stores email data in a single, monolithic 'Database' file. After time, this file can become too large to fit on a CD-R if one wants to backup his or her emails. This script exports all emails contained in a given mailbox to individual files. Note that I haven't done extensive testing of this script. I wrote this for a coworker who has used it without a hitch but that's not to say others might not have problems with it.

To use this script, copy the Applescript into Script Editor. Save the file as a compiled script. Then move the script file into: your user's Documents -> Microsoft User Data -> Entourage Script Menu Items folder. This will make the script available in Entourage's Script menu.

Read the rest of the hint for the script...


tell application "Microsoft Entourage"
  activate
  set mailFolders to {} as list
  repeat with i in folders
    set mailFolders to (mailFolders & name of i)
  end repeat
    
  set thisFolder to choose from list mailFolders with prompt 
  "Pick a mailbox to export" without multiple selections allowed
     
  if ((count of messages of folder named thisFolder) = 0) then
    display dialog "'" & (thisFolder as string) & 
    "' contains no emails" buttons "OK" default button 1
          
  else
    set docFolder to (path to documents folder from user domain)
    set fpath to (choose folder default location docFolder with prompt 
    "Choose a folder in which to store your emails" 
    without multiple selections allowed) as string
    set fcount to 0
               
    repeat with i in messages of folder named thisFolder
      set fcount to fcount + 1
      set newFname to "" as string
      set fname to (subject of i) as string
                 
      if ((count of characters of fname) > 30) then
        set fname to ((characters 1 thru 25 of fname) & "...") as string
      end if
                        
      if (fname contains ":") then
        repeat with j in characters of fname
          if (j as string = ":") then
            set newFname to newFname & "-"
          else
            set newFname to newFname & j
          end if
        end repeat
        set fname to newFname
      end if
                        
      set fname to (fpath & fname) as string
                        
      tell application "Finder"
        if (exists file (fname)) then
          set k to 1
          repeat while (exists file (fname & "-" & (k as string)))
            set k to k + 1
          end repeat
          set fname to (fname & "-" & (k as string))
        end if
      end tell
                      
      save i in fname
      tell application "Finder" to update file fname
                        
    end repeat
            
    tell application "Finder"
      activate
      if (fcount = 1) then
        display dialog "Exported 1 email to folder '" & (name of folder fpath) 
        & "'" buttons {"OK"} default button 1 with icon note
      else
        display dialog "Exported " & (fcount as string) & " emails to folder '" & 
        (name of folder fpath) & "'" buttons {"OK"} default button 1 with icon note
      end if
      open folder fpath
    end tell

  end if
end tell
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[26,287 views]  

An AppleScript to export Entourage emails | 7 comments | Create New Account
Click here to return to the 'An AppleScript to export Entourage emails' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to export Entourage emails
Authored by: syko on Feb 16, '04 12:30:36PM

a much better solution would be to ditch the extremely bloated corruptable m$ crap and go to Apple's Mail.

seriously.



[ Reply to This | # ]
An AppleScript to export Entourage emails
Authored by: CyborgSam on Feb 16, '04 12:57:35PM

Been there, done that. I've tried to convert twice, once with Jaguar, once with Panther. After a few days I went back to Entourage. Right now, I find that Entourage is still more intuitive and a better integrated package than Mail, iCal, and Address Book. I hope Apple's next rev of these apps addresses the major issues raised in forums, press, etc.

I hate M$ too. Remember that Entourage was written by the same folks who brought us Claris Emailer, so it's easy to use, intuitive, etc. Entourage is a rare exception among M$'s offerings. It isn't perfect, but it works all day without crashing or causing major snafus, unlike Word, Excel, et al.



[ Reply to This | # ]
An AppleScript to export Entourage emails
Authored by: syko on Feb 16, '04 01:01:02PM

intuitive?

an email program is an email program.. how does Apple's Mail program 'fail'?

I've had many clients spend hundreds of dollars so I can 'save' their corrupted databases..

Not only can m$'s database become corrupt at any time it's also EXTREMELY bloated (the database file) AND very slow...

Sure, the interface can be considered 'nice' but with Apple's Mail you've got the best junkmail filtering out there plus an easy to use interface- Apple did make it afterall ;)



[ Reply to This | # ]
An AppleScript to export Entourage emails
Authored by: rikske on Feb 16, '04 02:36:52PM

You ask hundreds of dollars to your clients for a rebuild ? I give support for 160 Mac's, and never was a database so corrupted that it couldn't be saved by a rebuild. (by pressing just the alt-key during startup of Entourage)



[ Reply to This | # ]
An AppleScript to export Entourage emails
Authored by: ewelch on Feb 16, '04 06:47:35PM

Another good way to handle it is to get Entourage Email Archive. It's a great program with lots of options for how the handle Entourage Emails. You can find it at Versiontracker.com. When I bought it, it cost $15.

Some of us don't have a choice, we have to use Entourage at work. So this kind of solution is great. All my old emails are now in a Filemaker database. (The author of EEA includes a Filemaker template.)

---
Eric

Ernest Hemingway's writing reminds me of the farting of an old horse. - E.B. White



[ Reply to This | # ]
An AppleScript to export Entourage emails
Authored by: Fofer on Feb 16, '04 01:35:12PM

Interesting tip, but for the record there are quite a few time-tested utilities a (check VersionTracker) that can assist with the exporting/archiving/migration from Entourage, either to text files, FileMaker files, or other mail programs.



[ Reply to This | # ]
An AppleScript to export Entourage emails
Authored by: mmmmark on Feb 16, '04 03:30:42PM

Dragging any root folder out of Entourage creates a .mbox file which can be archived separately to CD. Later, this file can be imported back into Entourage with ease.

This is how I back up my VERY large database.



[ Reply to This | # ]