Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Once in a while it may be useful to add some reminders to Reminders.app from the command line — especially because they are synced to iCloud. Is there any way to do so?

A solution that does not rely on AppleScript is preferred: a) for performance reasons (probably silly) and b) AppleScript solutions often feel clumsy or overly verbose to me.

share|improve this question
2  
Why do you prefer not to use AppleScript? –  Daniel Lawson Oct 11 '12 at 1:24

2 Answers 2

up vote 5 down vote accepted
osascript - title <<END
on run a
tell app "Reminders"
tell list "Reminders" of default account
make new reminder with properties {name:item 1 of a}
end
end
end
END

You could also create an Automator workflow with just an empty New Reminders Item action and then run it with automator -i title test.workflow.

See also this post at Mac OS X Hints.

share|improve this answer
    
Thank you for your answer. Unfortunately, this does not run in either a shell script or in Script Editor. What am I missing? –  myhd Oct 11 '12 at 7:27
    
Either add #!/usr/bin/env bash as the first line and run chmod +x /path/to/script, or run bash /path/to/script.sh. Or remove the first and last lines and save it AppleScript Editor. –  ؘؘؘؘ Oct 11 '12 at 15:43
    
The Automator hint did the trick! In contrast to the AppleScript solution it does not need to launch the Reminders.app, which is exactly what I wanted. –  myhd Oct 16 '12 at 9:00

Here's another version that allows you to set the title, end date and time via command line arguments.

#!/usr/bin/env bash                                                                                                               
# Make a new reminder via terminal script                                                                                         
# args: remind <title> <date> <time>                                                                                                                                                                                 

osascript - "$1" "$2" "$3" <<END                                                                                                        
on run argv                                                                                                                       
    set stringedAll to date (item 2 of argv & " " & item 3 of argv)                                                               
    tell application "Reminders"                                                                                                  
        make new reminder with properties {name:item 1 of argv, due date:stringedAll}                                             
    end tell                                                                                                                      
end run                                                                                                                           
END    

So if you were to name this script "remind" and give it executing privileges (chmod 755 remind), you could do this:

$ ./remind "Go to grocery store" 12/15/2013 10:00:00PM                              
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.