For example we want to simply write "Bowling with Bob 6PM on Friday" and have Reminders parse out the date and time to create a reminder(name="Bowling with Bob", datetime="2012-09-01 18:00:00")
Here is the script, note that I have it in Alfred-friendly form since I use the Alfred app launcher:
on alfred_script(q)
try
tell application "Reminders"
activate
activate -- Single activate doesn't always work, esp if Reminders is closed.
show list "Reminders"
tell application "System Events" to keystroke "n" using command down
tell application "System Events" to keystroke q
tell application "System Events" to key code 36 -- enter
end tell
on error a number b
display dialog a
end try
end alfred_script
-- how to call:
--alfred_script("Bowling with Bob 6PM on Friday")
No comments:
Post a Comment