Skip to content

Instantly share code, notes, and snippets.

@tjluoma
Created November 5, 2014 03:59
Show Gist options
  • Select an option

  • Save tjluoma/a9c3d652011a00857cca to your computer and use it in GitHub Desktop.

Select an option

Save tjluoma/a9c3d652011a00857cca to your computer and use it in GitHub Desktop.
launchd plist to be used with https://github.com/danielpunkass/RemindersImport. Assumes: 1) /usr/local/bin/RemindersImport is the correct path; 2) your Reminders.app reminders list is "My Reminders List" (edit to suit you). be sure to change "/Users/luomat/" to the proper path to your "/Users/shortname" on your Mac!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.tjluoma.omnifocus.RemindersImport</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/RemindersImport</string>
<string>My Reminders List</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/Users/luomat/Library/Calendars</string>
</array>
</dict>
</plist>
@tjluoma
Copy link
Author

tjluoma commented Nov 5, 2014

The WatchPaths key tells launchd to run the program whenever /Users/luomat/Library/Calendars changes, which will happen whenever new Reminders are sync'd from iCloud. (It will happen at other times too, but RemindersImport is smart enough to only launch OmniFocus when it finds an actual reminder.)

Be sure to change "My Reminders List" to the name of the Reminders list that you want to import into OmniFocus!

Note sure what to use for the WatchPaths on your Mac? Use whatever you get from this command:

echo "$HOME/Library/Calendars"

(launchd plist files cannot use $HOME so you have to put the actual value in there.)

@tjluoma
Copy link
Author

tjluoma commented Nov 5, 2014

Oh! I suppose I ought to tell you how to use this!

To Install

Save it as ~/Library/LaunchAgents/com.tjluoma.omnifocus.RemindersImport.plist and then enter this in Terminal.app:

launchctl load ~/Library/LaunchAgents/com.tjluoma.omnifocus.RemindersImport.plist

That will immediately run RemindersImport program and then it will be triggered automatically in the future.

To uninstall

First do this in Terminal:

launchctl unload ~/Library/LaunchAgents/com.tjluoma.omnifocus.RemindersImport.plist

and then just delete the ~/Library/LaunchAgents/com.tjluoma.omnifocus.RemindersImport.plist file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment