Hi
Thnx for this great script it works just perfect :-)
I added these lines and now my Mac tells me how many new Mails I have got.
-----------------Added there----------------
if unreadMail is 1 then
tell application "Finder"
set txt to "There is " & unreadMail & " new Mail"
say txt
end tell
set popupMsg to "New mail from " & FromName & "- " & mailSubject & ": "=
&
mailContent
else if unreadMail is not 1 then
tell application "Finder"
set txt to "There are " & unreadMail & " new Mails"
say txt
end tell
set popupMsg to unreadMail & " new mails. Most recent from " & FromName=
& "- " & mailSubject & ":" & mailContent as string
end if
---------------------------------------
It´s great if you set up getting Mail let´s say every 5 minits or so.
But to be able to look for new Mails whenever you like I wrote this little =
script
for Clicker.
--------------Check Mail----------
try
tell application "Mail"
check for new mail
end tell
end try
try
tell application "SEC Helper"
enter popup mode text "Searching for new Mails"
end tell
end try
----------------------------------------
Btw I have some problems getting Mails via DHCP.
My Mac is DHCP client of my PeeCee DHCP Server and everything works
great so far but getting Mails is a problem. Mail recognizes that there are=
new
Mails but doesn´t download them from server. It woun´t download no matter i=
f
firewall is active or not so can nebody help and tell me what to set up to =
be
able to get Mails over DHCP please.
--- In ericssonclient@yahoogroups.com, "oidipa_maas" <kastner@t...> wrote:
> Dear Clickers,
>
> here's a little script/trick to get new e-mail instantly displayed on
> your phone from any menu with just one click, as well as announced on
> the screen of your Mac.
>
> NOTA BENE: Using the script as described below is probably not
> recommended, and could possibly mess things up. It has been
> thoroughly tested for a week, though, and so far hasn't caused any confli=
cts
or other
> problems. For me, that is.
>
> Here's how it works:
> Whenever you receive a new mail it will be announced on the screen of
> your Mac, saying either "Reply from X", "Forwarded mail from X" or
> "New mail from X". (Hence you don't have to open Mail to see what the fuz=
z
is
> all about.)
>
> If you are away from your computer, just press "No" on the phone when
> you hear the Mail alert and a message will pop up and tell you all
> about it (sender, subject, and even mail content). If you've received mor=
e
> than one mail, the pop up message will tell you how many and display the =
most
> recent one. (You can of course press any key you like, but other keys tha=
n
"No" will
> result in a Clicker action. For example if you are using the iTunes Contr=
oller,
clicking
> "Yes" will pause iTunes while you are reading your mail.) If the mail is =
in
HTML format
> (graphical) Salling Clicker will not be able to display it, and tell you =
so.
>
> Since pop up messages are limited to 160 characters you might not get
> to read the whole mail, but you will at least get an idea of if it's
> worth leaving your sofa for. If you want to be able to read the whole mai=
l,
> see the hint on how to disable the 160 character limit posted somewhere i=
n
this
> forum. I haven't tried this yet, so I'm not sure if it works.
>
> So, no need to anxiously use any of the Check For New Mail-scripts
> anymore (and, if lucky, consult your computer to actually read them).
> Perhaps the best part is that you can now remove the Check For New Mail
script
> and make room for something more useful in the main menu, since this
script is not
> to be used with Salling Clicker, but with Mail.
>
> Here's how to do it (if you haven't guessed already):
> Copy the script below and paste it into Script Editor. Save the
> script. Open Mail. In Preferences, choose Rules and Add Rule. Set
> the first condition to Any and the second to Every Message and choose Run=
> Applescript as the perform action. Choose the script you just saved, and =
make sure
> the rule is the first one in the list of rules. Otherwise it will not wor=
k. That's it.
>
> The script is based on the various Speak Mail scripts found on
Macosxhints.com. Not
> sure who to give credit.
>
> Enjoy,
> Oidipa
>
>
> on perform_mail_action(info)
> try
> tell application "Mail"
> set unreadMail to 0
> set everyMail to |SelectedMessages| of info
> repeat with eachMail in everyMail
> set unreadMail to (unreadMail + 1)
> set fromAddress to sender of eachMail
> set breakAddress to " <"
> set nameEnd to the offset of breakAddress in fromAddress
> if nameEnd is not 0 then
> set FromName to (characters 1 through nameEnd of fromAddress) as string
> end if
> set mailSubject to subject of eachMail
> set mailContent to content of eachMail
> if mailSubject contains "Re:" or mailSubject contains "re:" then
> set screenMsg to "Reply from " & FromName
> else if mailSubject contains "Fwd:" or mailSubject contains "fwd:" then
> set screenMsg to "Forwarded mail from " & FromName
> else
> set screenMsg to "New mail from " & FromName
> end if
> tell application "SEC Helper"
> show screen message screenMsg
> end tell
> delay 2
> end repeat
> if unreadMail is 1 then
> set popupMsg to "New mail from " & FromName & "- " & mailSubject & ": " &=
> mailContent
> else if unreadMail is not 1 then
> set popupMsg to unreadMail & " new mails. Most recent from " & FromName
& "- " &
> mailSubject & ":" & mailContent as string
> end if
> tell application "SEC Helper"
> enter popup mode text popupMsg
> end tell
> end tell
> on error
> tell application "SEC Helper"
> enter popup mode text "Sorry! Can't display new mail."
> end tell
> end try
> end perform_mail_action