---
title: Things tasks from the command line
date: 2010-10-11 19:49
slug: things-tasks-from-the-command-line
categories:
- Code
tags:
- productivity
- scripting
- terminal
- things
---

<img src="/uploads/2010/10/thingsicon.jpeg" alt="thingsicon.jpeg" border="0" width="196" height="241" class="alignright" />If you're a [Things.app](http://culturedcode.com/things/) user (and a Terminal user), I've got a quick function for your .bash_profile that will allow you to quickly add todo items to your inbox with notes and natural-language date parsing.

It uses php's strtotime function, which does a pretty swell job with simple dates like "next tuesday" or "+12 days". It's not very smart, though; you have to give it parameters in a specific order: 

`td "task name" "natural language date" "note"`

Only the first parameter is required, so your task at least has a title. If you have two, it expects that the second is a date of some kind, and anything in the third will be added as a note.

Here's the code&hellip;
<!--more-->

```bash
function td() {
  if [ $# -lt 1 ]; then return 1;fi
  if [ $# -gt 1 ]; then
    duedate=`php -r "date_default_timezone_set('America/Chicago');echo date('m/d/y',strtotime('$2'));"`
    duedate=",due date:date \"$duedate\""
  fi
  osascript -e "tell application \"Things\"" \
  -e "make new to do at list \"Inbox\" with properties {name:\"$1\",notes:\"$3\"$duedate}" \
  -e "end tell"
}
```

Just paste it at the end of your ~/.bash_profile and type `source ~/.bash_profile` to read it in. If you use it, I'd love to hear about it, and if you improve it, let me know what you did differently!

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
