Skip to content

Instantly share code, notes, and snippets.

@mschae
Created December 19, 2011 11:03
Show Gist options
  • Save mschae/1496664 to your computer and use it in GitHub Desktop.
Save mschae/1496664 to your computer and use it in GitHub Desktop.
Alfred iCal Todo Script
on alfred_script(q)
tell application "iCal"
set newtodo to (make new todo at end of todos of calendar "Reminders")
tell newtodo
if "!!!" is in q then
set priority to high priority
else if "!!" is in q then
set priority to medium priority
else if "!" is in q then
set priority to low priority
end if
set asid to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"!"}
set textItems to text items of q
set AppleScript's text item delimiters to asid
set todoSummary to textItems as string
set summary to todoSummary
end tell
end tell
end alfred_script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment