• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mail rule applescript and displaying alert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail rule applescript and displaying alert


  • Subject: Re: Mail rule applescript and displaying alert
  • From: demski <email@hidden>
  • Date: Mon, 31 Mar 2008 12:29:54 +0200

Have you tried to put the tell-mail-block around the loop?
like in:
using terms from application "Mail"
	on perform mail action with messages selectedMessages
		tell application "Mail"
			repeat with eachMessage in selectedMessages

				display alert "test alert" message "test message" as warning
			end repeat
		end tell
	end perform mail action with messages
end using terms from

Am 20.03.2008 um 15:04 schrieb Philip Aker:
On 08-03-20, at 05:21, Jonny Taylor wrote:
I've been trying to sort out an applescript which displays an alert when certain urgent messages are received by apple Mail. I have the following script (for Tiger):

using terms from application "Mail"
	on perform mail action with messages selectedMessages
		repeat with eachMessage in selectedMessages
			tell application "Mail"
				display alert "test alert" message "test message" as warning
			end tell
		end repeat
	end perform mail action with messages
end using terms from

This doesn't work as I'd hoped - a blank dialog appears with no "OK" button or any other content, and I have to force-quit Mail.

Can anyone suggest what I'm doing wrong? This same question was asked by John C Welch on this list in July 06, but nobody offered an answer...


I believe Mail is running this portion in a secondary thread and normally AppleScript UI has to run on the main thread (haven't checked since 10.4).


Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@




_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden


mit besten Grüssen Kind regards

demski


die Anderen · digitale mediendienstleistungen Bellealliancestrasse 58 b 20259 Hamburg

fon +49 (0) 40 41 26 61 81
mob +49 (0) 172 40 70 319

Hinterhof der Firma Hertz & Selck



_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Mail rule applescript and displaying alert (From: Jonny Taylor <email@hidden>)
 >Re: Mail rule applescript and displaying alert (From: Philip Aker <email@hidden>)

  • Prev by Date: Rep : Mail scripting…
  • Next by Date: Re: [Sappho] I'm SO MAD
  • Previous by thread: Re: Mail rule applescript and displaying alert
  • Next by thread: FYI - Connection is invalid
  • Index(es):
    • Date
    • Thread