script to forward message without attachments.

J

joint52

Hello

I'm trying to write a script that forwards a message without
attachments. It also needs to change the recipient and the subject
line.

I've come up with the script below but the line "delete newWin's
attachments" doesn't work. I'm using Entourage 2004.

Thanks in advance



property recip : "(e-mail address removed)"

tell application "Microsoft Entourage"

-- get the currently selected message or messages
set selectedMessages to current messages

-- if there are no messages selected, warn the user and then quit
if selectedMessages is {} then
display dialog "Please select a message first and then run this
script." with icon 1
return
end if

repeat with theMessage in selectedMessages
set newWin to forward theMessage to recip
set the subject of newWin to "asdf"

delete newWin's attachments -- this doesn't work?

end repeat
end tell
 
B

Barry Wainwright

I started to take a look at this, but never got to a conclusion.

There are two problems.

First is that a draft message window doesn't have an 'id' as such, but is
referenced by its title. So, when you creat a new draft window with the
forward command it is know as 'window "FWD: [original subject]"'. This is
what is stored in your 'newWin' variabl.

But, then your script changes the subject, so the window is now called
'window "asdf"', but the script is still looking for the original window
title and can't find it.

That problem can easily be foxed by making the subject change the last thing
you do, or by referring to 'window 1', instead of trying to store the winodw
name.

The second issue s where I ran into a problem, and I haven't had time to
look a it properly yet - it appears that there is a bug preventing the
removal of attachments from draft windows! - I tried a coupl of variations,
and nothing seemed to work. When I get time, I'll dig a bit deeper, but I
don't see any easy way out of this. It can be got round, by creating new
outgoing message and copying the content into it, but the 'fwd' function
doesn't seem to work as it should for now. I'll report back when I've had a
chance to look a little deeper.


--
Barry Wainwright
Microsoft MVP (see <http://www.microsoft.com/mvp/> for details)
Visit the Entourage User¹s Weblog for Hints, tips and troubleshooting
information:
http://www.barryw.net/weblog/
 
P

Paul Berkowitz

The second issue s where I ran into a problem, and I haven't had time to
look a it properly yet - it appears that there is a bug preventing the
removal of attachments from draft windows! - I tried a coupl of variations,
and nothing seemed to work. When I get time, I'll dig a bit deeper, but I
don't see any easy way out of this. It can be got round, by creating new
outgoing message and copying the content into it, but the 'fwd' function
doesn't seem to work as it should for now. I'll report back when I've had a
chance to look a little deeper.

What's easier is to make a copy of the original message, remove the
attachment, then forward the copy, then delete the copy. Like so:

property recip : "(e-mail address removed)"

tell application "Microsoft Entourage"

-- get the currently selected message or messages
set selectedMessages to current messages

-- if there are no messages selected, warn the user and then quit
if selectedMessages is {} then
display dialog "Please select a message first and then run this
script." with icon 1
return
end if

repeat with theMessage in selectedMessages
--straight 'duplicate' will error for IMAP and Exchange messages
set dup to duplicate theMessage to drafts folder

delete attachments of dup
set newWin to forward dup to recip with opening window
set the subject of newWin to "asdf"

delete dup

end repeat
end tell


The 'duplicate' command specifies the (local) drafts folder, because on IMAP
and (I think) Exchange you can't duplicate in place - and don't need to,
since you're removing the duplicate in a moment anyway.

Are you aware that if you 'forward without opening window' you can do this
behind the scenes, without making a new window, and then send the forward
too? Above I specified 'with opening window' (which is the default and
doesn't actually need to be specified, as I think you know already).



--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
M

Maclazaro

I started to take a look at this, but never got to a conclusion.

There are two problems.

First is that a draft messagewindowdoesn't have an 'id' as such, but is
referenced by its title. So, when you creat a new draftwindowwith the
forward command it is know as 'window"FWD: [original subject]"'. This is
what is stored in your 'newWin' variabl.

But, then your script changes the subject, so thewindowis now called
'window"asdf"', but the script is still looking for the originalwindow
title andcan'tfindit.

That problem can easily be foxed by making the subject change the last thing
you do, or by referring to 'window1', instead of trying to store the winodw
name.

The second issue s where I ran into a problem, and I haven't had time to
look a it properly yet - it appears that there is a bug preventing the
removal of attachments from draft windows! - I tried a coupl of variations,
and nothing seemed to work. When I get time, I'll dig a bit deeper, but I
don't see any easy way out of this. It can be got round, by creating new
outgoing message and copying the content into it, but the 'fwd' function
doesn't seem to work as it should for now. I'll report back when I've had a
chance to look a little deeper.

--
Barry Wainwright
Microsoft MVP (see <http://www.microsoft.com/mvp/> for details)
Visit the Entourage User¹s Weblog for Hints, tips and troubleshooting
information:http://www.barryw.net/weblog/
From: Diane Ross <[email protected]>
Newsgroups: microsoft.public.mac.office.entourage
Date: Tue, 20 Nov 2007 15:05:43 -0800
Subject: Re: script to forward message without attachments.
If you don't get help on this newsgroup, try asking on the Entourage talk
list. There are many scripters there that can help. It's a low traffic list.
How to subscribe to the Microsoft Entourage talk list:

On November20Tuesday11/20/07 2:54 AM, in article
(e-mail address removed),

on of my computers displays a message saying:

entourage can't find window 1 do you know what this means? it does not
happen all the time but sometimes when closing entourage.
 
S

ss

a script to fwd with attachments? i havent been to fwd any mssgs WITH
attachments. this has never worked on osx 2004 entourage. it fwd all
mssgs without their attachments which is extremely annoying if the
mssgs have images with text strategically placed all over. i'm unable
to fwd these types of messages b/c the attachments are not included,
and if i manually add them, then the images are stacked at the bottom
of all the text, and the text comments and references are now useless.
 
E

Ed Kimball

Do you have "Send Attachments to Cc and Bcc recipients" selected in the
Compose preferences? See if that makes a difference.
 
S

ss

hi, i tried unchecking that option (it was already checked) but still
nothing. what i did notice though is that i can fwd any attachment
type except for jpgs, which is the main type i need to fwd :) is
there a way to specify to fwd as html or plain text?

on another note, how did you get your name to appear as the sender for
these group mssgs rather than your email addy like mine does. my
email addy is displayed for my posts here and obviously i dont want it
public aso i can avoid spam bots. i cant find a way to specify this
in my google account prefs.

also, is there a way to automatically get notified about replies?

thanks
 
E

Ed Kimball

My comments are below.


hi, i tried unchecking that option (it was already checked) but still
nothing. what i did notice though is that i can fwd any attachment
type except for jpgs, which is the main type i need to fwd :) is
there a way to specify to fwd as html or plain text?
By default, Entourage forwards in the same format as the original message.
What version of Entourage are you using. My version (10.3.6 on OS X 10.4.11)
forwards attached JPGs. What it does not forward are images embedded as HTML
links rather than attachments. Instead it displays the HTML. Can that be
your problem?
If it is, try Forward as Attachment instead of Forward.
on another note, how did you get your name to appear as the sender for
these group mssgs rather than your email addy like mine does. my
email addy is displayed for my posts here and obviously i dont want it
public aso i can avoid spam bots. i cant find a way to specify this
in my google account prefs.
Entourage displays as the sender the Name field of the e-mail account from
which I post to the newsgroup. Do you have the Name field filled in on your
e-mail account?
also, is there a way to automatically get notified about replies?
Not that I'm aware of. Maybe one of the MVPs knows a way to do this.
....
 
D

Diane Ross

on another note, how did you get your name to appear as the sender for
these group mssgs rather than your email addy like mine does. my
email addy is displayed for my posts here and obviously i dont want it
public aso i can avoid spam bots. i cant find a way to specify this
in my google account prefs.

also, is there a way to automatically get notified about replies?

Use Entourage as your newsreader. You can set Entourage to use a no spam
address.

How to subscribe to the Microsoft Entourage talk list:

<http://www.entourage.mvps.org/support_options/subtalk.html>

For directions on creating your own fake 'nospam' account see:

<http://www.entourage.mvps.org/get_started/tip019.html>
 
S

ss

My comments are below.



By default, Entourage forwards in the same format as the original message.
What version of Entourage are you using. My version (10.3.6 on OS X 10.4.11)
forwards attached JPGs. What it does not forward are images embedded as HTML
links rather thanattachments. Instead it displays the HTML. Can that be
your problem?
If it is, try Forward as Attachment instead of Forward.

i'm using 11.3.6 on osx 10.4.11. it's been happening though with the
last several entourage versions. these messages i'm trying to fwd
definitely have jpg attachments. it does not fwd them. wait! i tried
'redirect' and this seems to work fine! jeez, if i only knew what
this was before :) this is even better than fwd b/c it doesnt add
quotations to everything.
Entourage displays as the sender the Name field of the e-mail account from
which I post to the newsgroup. Do you have the Name field filled in on your
e-mail account?

actually i post these mssgs from the website, not entourage.

thanks
 
S

ss

actually the redirect doesnt do what i want b/c it displays the
original sender's addy and locks the email you cant edit any images or
text.
 

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