Created
May 12, 2012 14:31
-
-
Save dlinsin/2666823 to your computer and use it in GitHub Desktop.
Alfred Apple Script Extension to create iCal Reminder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- extended from http://www.dirtdon.com/?p=1261 | |
on alfred_script(q) | |
tell application "iCal" | |
activate | |
set theDueDate to (current date) + 1 * days | |
set time of theDueDate to 0 | |
set hours of theDueDate to 8 | |
set newtodo to (make new todo at end of todos in calendar "Private" with properties {summary:q, due date:theDueDate}) | |
tell calendar "Private" | |
tell newtodo | |
make new sound alarm at end with properties {trigger date:theDueDate} | |
end tell | |
end tell | |
end tell | |
tell application "System Events" | |
set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0 | |
end tell | |
if isRunning then | |
tell application id "com.Growl.GrowlHelperApp" | |
set the allNotificationsList to ¬ | |
{"New Reminders Task"} | |
set the enabledNotificationsList to ¬ | |
{"New Reminders Task"} | |
register as application ¬ | |
"New Reminders Task" all notifications allNotificationsList ¬ | |
default notifications enabledNotificationsList ¬ | |
icon of application "iCal" | |
notify with name ¬ | |
"New Reminders Task" title ¬ | |
"New Task Created" description ¬ | |
"Task: " & q ¬ | |
application name "New Reminders Task" | |
end tell | |
end if | |
end alfred_script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Superb!