How can I copy message attachment history?

L

llee

I'm using the latest available version of Entourage as an Exchange
email client. I can remove attachments to messages received through the
Exchange account by copying the message to a local mail folder, then
editing, then copying the message back to an Exchange account folder.
How can I copy message attachment removal history before
synchronization with Exchange Server wipes it out? Thanks.
 
B

Barry Wainwright [MVP]

You can't directly, but there are script available at scriptbuilders @
macscripter.net | script archive <http://scriptbuilders.net/> that will
remove the attachment and leave a comment in the message body.

Note that with Exchange & IMAP accounts, only the locally cached message is
modified, not the copy on the server, unless you copy the message to another
folder.
 
L

llee

Barry said:
You can't directly, but there are script available at scriptbuilders @
macscripter.net | script archive <http://scriptbuilders.net/> that will
remove the attachment and leave a comment in the message body.

Note that with Exchange & IMAP accounts, only the locally cached message is
modified, not the copy on the server, unless you copy the message to another
folder.

Thanks for the advice. I've tried Paul's Save Attachments 2004, and it
does work for a message with attachments that was downloaded from a
pop3 server or copied into a local folder from a synchronized Exchange
folder. But what I want to do is to perform the action on messages
received through the Exchange account, then put them back into a
synchronized Exchange folder. I would expect to get the result I want
by copying the Exchange message containing the attachment to a local
mail folder, running the script (or removing the attachment manually),
then copying the edited message, which now contains a link for the
removed attachment, back to an Exchange folder. This appears to achieve
the precise result I want - until the Exchange folder into which I
copied the edited message is synchronized, at which time the link to
the removed attachment disappears. Is there any way to keep a message
containing a removed attachment link in a synchronized Exchange folder?
If not, is there at least a way to edit the script so that the body of
the message is edited so that it indicates that an attachment was
removed along with the name of the attachment? Thanks again.
 
B

Barry Wainwright [MVP]

Thanks for the advice. I've tried Paul's Save Attachments 2004, and it
does work for a message with attachments that was downloaded from a
pop3 server or copied into a local folder from a synchronized Exchange
folder. But what I want to do is to perform the action on messages
received through the Exchange account, then put them back into a
synchronized Exchange folder. I would expect to get the result I want
by copying the Exchange message containing the attachment to a local
mail folder, running the script (or removing the attachment manually),
then copying the edited message, which now contains a link for the
removed attachment, back to an Exchange folder. This appears to achieve
the precise result I want - until the Exchange folder into which I
copied the edited message is synchronized, at which time the link to
the removed attachment disappears. Is there any way to keep a message
containing a removed attachment link in a synchronized Exchange folder?
If not, is there at least a way to edit the script so that the body of
the message is edited so that it indicates that an attachment was
removed along with the name of the attachment? Thanks again.

Are you talking about messages in public folder postings, rather than in
mail messages?

I suspect that both these will suffer the same fate - the message history is
a purely local attribute and will not be synced to the server.
 
L

llee

Barry said:
Are you talking about messages in public folder postings, rather than in
mail messages?

No, but as you say, the difference is probably moot regarding this
issue. Anyway, can you tell me what Applescript command might be used
to get attachment names as a string? If so, Save Attachments 2004 is
editable, so there's a chance I could simply let it do its job with the
additional step of placing the names of removed attachments in the body
of the message being edited in addition to creating the links. That
way, if I move the messages back to a synched Exchange folder, I would
still have a list of removed attachments even though the links would
eventually disappear. Thanks.
 
B

Barry Wainwright [MVP]

No, but as you say, the difference is probably moot regarding this
issue. Anyway, can you tell me what Applescript command might be used
to get attachment names as a string? If so, Save Attachments 2004 is
editable, so there's a chance I could simply let it do its job with the
additional step of placing the names of removed attachments in the body
of the message being edited in addition to creating the links. That
way, if I move the messages back to a synched Exchange folder, I would
still have a list of removed attachments even though the links would
eventually disappear. Thanks.

name of every attachment of theMessage
(where 'theMessage' contains a reference to a message)

This will get you an AppleScript list of attachment names as Unicode
(UTF-16) text strings.
 
L

llee

Barry said:
name of every attachment of theMessage
(where 'theMessage' contains a reference to a message)

This will get you an AppleScript list of attachment names as Unicode
(UTF-16) text strings.

Thanks! Here's a script that will move a message to the local inbox and
edit its body to include a note about attachments, leaving the new
version of the message open. It uses UI Scripting.

set attachment_string to ("Message attachments as of" & space &
(current date) & ":" & return)
tell application "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
set mytitle to (subject of theMsg as string)
duplicate theMsg to inbox folder -- works only in 2004
delete theMsg
set thenewMsg to item 1 of (every message of inbox folder whose
subject is mytitle)
set msgAttachments to attachments of thenewMsg
repeat with i from (count msgAttachments) to 1 by -1
set theAttachment to item i of msgAttachments
set attachName to name of theAttachment
set attachment_string to attachment_string & attachName & return
end repeat
set the clipboard to attachment_string
open thenewMsg
activate
end tell
delay 1
tell application "System Events"
tell process "Microsoft Entourage"
-- GUI Scripting statements:
click menu item "Edit Message" of menu "Message" of menu bar item
"Message" of menu bar 1
delay 0.6
keystroke tab
delay 0.6
keystroke attachment_string
end tell
end tell
 
Top