Re: Applescript: referring to selected email in Mail



In article <1hao576.1wb3ea7s6jqjnN%me3@xxxxxxxxxxx>, zoara
<me3@xxxxxxxxxxx> wrote:

Ingvar Nedrebo <inn@xxxxxxxxxx> wrote:

In article <1hanbej.g6dswt14ncbaaN%me3@xxxxxxxxxxx>, zoara
<me3@xxxxxxxxxxx> wrote:

How do I refer to a message (and/or number of messages) that are
selected in Mail? I have a bunch of actions I want to perform on a given
email(s) but can't refer to them! For example's sake, let's say I want
to display a dioalog saying who the email is from...

I got this to work:

set msgs to selection
repeat with this_message in msgs
set adr to extract address from sender of this_message
display dialog "message is from " & adr
end repeat

I tried "repeat with this_message in selection", which didn't work. I
have no idea why.

Thankyou. Got it all sorted now;

Goody.

it's a manual "stop sending me this
crap email" script that looks - at least to the technically numpty -
entirely automated. Girlfriend has several friends who insist on sending
her stupid forwarded emails (you know, the sort that got old after you'd
seen your third one) even after repeated requests not to. "Yeah, but I
thought you'd like *this* one, it's funnier than the others".

She asked whether there was any way to make it look like they were
getting sent back, so I whipped up a script to do just that. It's more a
joke than anything else, to be honest.... it pretends that the email has
been 'statistically analysed' and has scored highly enough to be
rejected instead of being delivered.

Given the target audience, do you think that kind of wording will deter
them in the future? :-)

i.

--
Remove all numbers to reply.
.



Relevant Pages

  • Re: One category disappeared
    ... set chosenCategoryName to choose from list with title "Category Selection" with prompt "Select a category to be applied to Group Members..." ... repeat until catCreated ... set creationResult to display dialog "Name for new category..." ... set chosenCategory to ...
    (microsoft.public.mac.office.entourage)
  • Re: Batch Editing Contacts
    ... No way to "batch edit", exactly, but a script can select a group of contacts ... set theList to the selection ... repeat with theC in theList ... set theID to (the ID of theC as string) ...
    (microsoft.public.mac.office.entourage)
  • Re: Applescript: referring to selected email in Mail
    ... set msgs to selection ... repeat with this_message in msgs ... set adr to extract address from sender of this_message ... I tried "repeat with this_message in selection", ...
    (uk.comp.sys.mac)
  • Re: Applescript: referring to selected email in Mail
    ... nowhere on the web seems to have a script that does this. ... repeat with this_message in msgs ... set adr to extract address from sender of this_message ... I tried "repeat with this_message in selection", ...
    (uk.comp.sys.mac)
  • RE: Print Frozen Panes?
    ... Click in the Rows to repeat at top: box and select the rows you want to see ... click Print Area and Set Print Area. ... choose Selection under Print what. ... range with the header rows is now all that will print. ...
    (microsoft.public.excel.misc)