How to do a script that speaks out iCal alarms?


All help welcome, I need to do an Applescript that speaks out an iCal alarm when iCal launces that script.
I know that iCal can launch a script but how do I transfer the alarm text :frowning: I am not good in this … all ideas are welcome! :smiley:

… and here another qustion, is it possible to get the Mail program to speak out something when new mail arrives? Maybe the subject? A script that monitors the Mail-program?

There are several example scripts in /Library/Scripts/ folder.
This one will speak the sender and subject.

“/Library/Scripts/Mail Scripts/Speak Sender and Subject.scpt”

Nice, thanks, I found the script. It’s working great but it’s just repeating the sender and subject of the message that I have activated in the Mail program.
Is it possible to get the script to monitor the Mail and speak it loud itself?

I mean, is it possible to get the Mail program to speak out the incoming message instead of submarine or other boing? :slight_smile:

How about that iCal thing? Is it possible to get the iCal speak the alarms out?
I mean, is it possible to get the iCal program to speak out the alarm instead of frog or other boing? :slight_smile:


in you can create a rule which can run an AppleScript.
The corresponding script must be wrapped in this event handler

using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		repeat with eachMessage in theMessages
			-- do something
		end repeat
	end perform mail action with messages
end using terms from

To speak the content of the mail use the keyword content instead of subject or sender.
The say command without any parameter speaks with the default voice.

To catch an event in iCal is much more difficult, because there is no event handler.
You could use something like this to get the current event

tell (current date) to set ct to it - (its seconds)
tell application "iCal"
	repeat with oneCal in (get calendars)
		repeat with oneEvent in (get events of oneCal whose start date is ct)
			if oneEvent is not missing value then
				tell oneEvent to set {s, d, l} to {summary, description, location}
				-- do something like growl notification 
			end if
		end repeat
	end repeat
end tell

Thanks for the quick reply, info and examples :slight_smile:

Huh, this is some diffucult stuff for me :frowning: I have serious problems to understand Applescript. But moving forward all the time :wink:
I do not get it with iCal, isn’t there any easier way to from iCal somehow transfer the alarm-subject to AppleScript?

I recommend to learn the basics. There are lots of good tutorials in unScripted


Hi Dunkel,

Try to search for Growlit, it’s an applescript that handles your requirement to speak out iCal alarms using Growl.




You are eager !! :slight_smile:

I just wanted to recommend an easy going book, which is fun!! Still covers the basics and gives you a good foundation for further explorations. - its a really great starting book with lots of practical examples.

It’s AppleScript the Missing Manual by Adam Goldstein from O’Reilly, isbn 0-596-00859-3.

You may maybe find it at safari books online