Combining Databases?

D

David M. Glasgow

Hi there!

Due to an embarrassingly stupid error on my part, I've deleted 4,000+
e-mail messages from my database. (By this I mean I accidentally told
a schedule to delete mail from the deleted items folder older than
FOUR days, instead of four HUNDRED days....)

The good news is that I have a backup of the database pre-catastrophe,
so I could in a pinch create a new identity called "Archive" or some
such to access those messages. But is there a way to merge the old
database with the new, so that I'll have all the old messages in the
same place as messages that have come in since the error?

Thanks in advance!

: )
David
 
B

Barry N. Wainwright

Hi there!

Due to an embarrassingly stupid error on my part, I've deleted 4,000+
e-mail messages from my database. (By this I mean I accidentally told
a schedule to delete mail from the deleted items folder older than
FOUR days, instead of four HUNDRED days....)

The good news is that I have a backup of the database pre-catastrophe,
so I could in a pinch create a new identity called "Archive" or some
such to access those messages. But is there a way to merge the old
database with the new, so that I'll have all the old messages in the
same place as messages that have come in since the error?

Thanks in advance!

: )
David

Open the old database, put the messages you want to save in a folder, and
drag than folder out of entourage to the desktop, where it will create a
..MBOX file. Switch to the newer database and drag this MBOX into the folder
listing.

In case you can¹t avoid bringing in duplicates, this script will remove
duplicates from a folder:


tell application "Microsoft Entourage"
set theMessages to current messages
if theMessages = {} then
set theFolder to selection
if class of theFolder is folder then
set mb to theFolder
else
display dialog "In the folder listing, please select the folder
you want to be scanned for duplicates" with icon stop buttons {"Quit"}
default button 1
return -99

end if
else
set mb to storage of item 1 of theMessages
end if
set theName to name of mb
say "Removing duplicates from mail folder: " & theName
set y to count messages of mb
say "Number of messages to check, " & y
set IDlist to {}
repeat with x from y to 1 by -1
try
set theHeaders to (get headers of message x of mb)
set AppleScript's text item delimiters to "Message-"
set temp to text item 2 of theHeaders
set AppleScript's text item delimiters to return
set theId to text 5 through -1 of text item 1 of temp
on error
set theId to ""
end try
if theId is in my IDlist then
delete message x of mb
else if theId ‚ "" then
copy theId to end of my IDlist
end if
if x mod 100 = 0 then say "" & x
end repeat
set removedCount to y - (count messages of mb)
if removedCount is 0 then
say "Finished. No duplicates detected"
else
say "Finished. " & removedCount & " duplicates removed"
end if
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>

Please post responses to this newsgroup. If I ask you to contact me
off-list, remove '.INVALID' from email address before replying.
 
D

David M. Glasgow

Hi Barry--

First, thanks SO much. The messages bounced over like a charm using
the MBOX trick.

Second, could you clarify a couple of the operators in that
AppleScript? When I drag the script from Safari into AppleScript
Editor, it seems to cause a few text encoding glitches. (Everything
seems to be okay up until about a dozen lines from the end, where I
see three question marks in place of what I assume should be a
comparative operator of some sort.)

When you have a moment, could you review the last lines of that script
and describe what I should be entering there?

THANKS again!

: )
David
 
B

Barry N. Wainwright

Hi Barry--

First, thanks SO much. The messages bounced over like a charm using
the MBOX trick.

Great, glad it worked :)
Second, could you clarify a couple of the operators in that
AppleScript? When I drag the script from Safari into AppleScript
Editor, it seems to cause a few text encoding glitches. (Everything
seems to be okay up until about a dozen lines from the end, where I
see three question marks in place of what I assume should be a
comparative operator of some sort.)

When you have a moment, could you review the last lines of that script
and describe what I should be entering there?

THANKS again!

: )
David

I'll take a guess at this block...
if theId is in my IDlist then
delete message x of mb
else if theId ‚ "" then
copy theId to end of my IDlist
end if

Where the middle line reads 'else if theID [is not equal to] "" then'

The [is not equal to] character is typed with an option-equals.

--
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>

Please post responses to this newsgroup. If I ask you to contact me
off-list, remove '.INVALID' from email address before replying.
 
D

David M. Glasgow

Thanks, Barry--I was assuming it was a not-equals, but didn't want to
phutz blindly with your script....

Making that correction got the script to where it would compile, but
apparently there were a couple of other glitches in the conversion. I
had to make the following small "tweaks" to get the script to run:


LINE 3 WAS:
if theMessages {} then
SHOULD BE:
if theMessages = {} then

9 LINES FROM END WAS:
if x mod 100 0 then say "" & x
SHOULD BE:
if x mod 100 = 0 then say "" & x


With those fixes, the script worked beautifully. Thanks so much for
your help!

: )
David
 
B

Barry N. Wainwright

Thanks, Barry--I was assuming it was a not-equals, but didn't want to
phutz blindly with your script....

Making that correction got the script to where it would compile, but
apparently there were a couple of other glitches in the conversion. I
had to make the following small "tweaks" to get the script to run:


LINE 3 WAS:
if theMessages {} then
SHOULD BE:
if theMessages = {} then

9 LINES FROM END WAS:
if x mod 100 0 then say "" & x
SHOULD BE:
if x mod 100 = 0 then say "" & x


With those fixes, the script worked beautifully. Thanks so much for
your help!

: )
David

Yes, those are the correct corrections - it looks as though whatever web
interface you are using wrecks the character set transliterations.

--
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>

Please post responses to this newsgroup. If I ask you to contact me
off-list, remove '.INVALID' from email address before replying.
 
M

Mickey Stevens

Yes, those are the correct corrections - it looks as though whatever web
interface you are using wrecks the character set transliterations.

Yes, Google Groups does do that. That's why scripts copied from there often
don't work. In the future, David, it might be in your best interest to use
a proper newsreader. There are a number of them at
<http://www.newsreaders.com/mac/clients.html>. If you want to set up
Outlook Express or Entourage, you can find instructions here:
<http://www.microsoft.com/mac/community/community.aspx?pid=community&page=ne
wsreaders#step2>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top