How can I get the return of the following script to be spoken?
set today to current date
set time of today to 0
set tomorrow to today + 1 * days
tell application “Calendar”
set the_calendar to first calendar whose name is “main calendar”
tell the_calendar
set the_list to summary of every event whose start date is greater than or equal to today and start date is less than tomorrow
end tell
return the_list
end tell
I don’t have Calendar, so I can’t make it work for you. But if you remove the return the_list statement from the tell “Calendar” block, and append the code below after the tell “Calendar” block (remove the fruits of my list, as they are just for demo), then you should hear your summaries.
set the_list to {"bananas", "oranges", "pears"}
set {tids, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "[[ emph +]].. " & return}
set the_text to the_list as text
set AppleScript's text item delimiters to tids
say the_text
set today to current date
set time of today to 0
set tomorrow to today + 1 * days
--
tell application "Calendar"
set the_calendar to first calendar whose name is "main calendar"
tell the_calendar
set the_list to summary of every event whose start date is greater than or equal to today and start date is less than tomorrow
end tell
end tell
set {TID, text item delimiters} to {text item delimiters, return}
set textToSpeak to the_list as text
set text item delimiters to TID
say textToSpeak
I still recommend using the text item delimiter I created, curtsey of Mac Os X internals! as it is nice with a little break between summaries, with just a return, the summaries comes to close to each other.
It is of course a matter of personal preference.
set the_list to {"There was a young man of Japan", "Whose limericks never would scan.", "When asked why this was,", "He replied \"It's because", "I always try to fit as many syllables into the last line as ever I possibly can.\""}
set {tids, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "[[ emph +]].. " & return}
set the_text to the_list as text
set AppleScript's text item delimiters to tids
say the_text