Hey All,
I found this thread while trying to make an email reminder script in Mavericks. Here's what I have:
(choose from list {"20 Minutes", "2 Hours", "4 Hours", "Tomorrow", "2 Days", "3 Days", "1 Week", "1 Month", "3 Months", "6 Months", "1 Year"} with prompt "When should we follow up?")
set list_answer to result as text
if list_answer = "20 Minutes" then
set list_answer to "16"
else if list_answer = "30 Minutes" then
set list_answer to "30"
else if list_answer = "2 Hours" then
set list_answer to "120"
else if list_answer = "1 Day" then
set list_answer to "1440"
else if list_answer = "1 Month" then
set list_answer to "43200"
end if
tell application "Calendar" to activate
tell application "Calendar"
set miniaturized of window 1 to true
tell application "Mail"
set theSelection to selection
set theMessage to item 1 of theSelection
set theurl to "message://%3c" & theMessage's message id & "%3e"
set thedes to theMessage's content & "Show in Mail " & "message://%3c" & theMessage's message id & "%3e"
set input to theMessage's subject
end tell
end tell
tell application "Calendar"
tell calendar "Email Reminders"
set ReminderDate to (current date) + list_answer * minutes
set new_event to make new event with properties {description:thedes, url:theurl, summary:input, location:theurl, start date:ReminderDate, end date:ReminderDate + 10 * minutes}
end tell
tell new_event
make new mail alarm with properties {trigger interval:0}
end tell
show new_event
end tell
I'm new to this so I am sure there is a more elegant method of doing this. However, the problem I am having is that the event and mail reminder seem to be creating just fine, but the email alert never is delivered, only the on screen alert activates. If I create the reminder manually, the email is delivered just fine. Anyone have any ideas ideas or tips?
Rick