Faster Numbering of OmniFocus Tasks

I wrote up how I’m numbering tasks in OmniFocus, but I’ve now modified the Keyboard Maestro recipe so it’s just a touch faster.

Here’s a screenshot:

Updated, faster recipe for numbering tasks in OmniFocus

Updated, faster recipe for numbering tasks in OmniFocus

I’ve also since created a separate recipe in Keyboard Maestro for each key Project I have in OmniFocus, each with it’s own .txt file that it refers to. This lets me do

,,taskadmin

and it’ll spit out “(Admin #7)” or if I type

,,taskcrm

it’ll spit out “(CRM #15)”.

Numbering tasks in OmniFocus 2 for Mac OS X

I’m using OmniFocus 2 on my MacBook Pro and wanting to ‘number’ tasks because at the end of each week, I print a PDF of the tasks completed and outstanding for a particular client. Task numbers make it much easier for the client to reconcile the work I’ve done with the lists they use.

The problem is that OmniFocus doesn’t have a ‘task number’ function.

Keyboard Maestro and a shell script to the rescue. This allows me to get the next sequential task number. Now all I do is type

,,task

and it expands out to the next available task number.

In a nutshell I use the shell script to get a variable from a text file (which is the last task number I used), and increment it. Keyboard Maestro is wrapped around this to both trigger it and make it look pretty.

The shell script itself is quite basic, any improvements you can suggest, please do.

Here is a screenshot of the Keyboard Maestro recipe (edit: I’ve since modified this recipe to be a little faster)

Keyboard Maestro recipe to increment task number

Get last task number, increment it, save it.

This relies on you having a text file named

last_task_number.txt

in your home folder.

The format of this file is just a single line of text as follows:

TaskNumber=0

MySQL – Counting how many rows have a particular value

Working on a SugarCRM dashboard today, and I needed to count how many records had one value and how many records had a second value. I then wanted to know what percentage the first value was of the total. So there’s a bit of MySQL code that helps make this easy to do.


SELECT
  SUM(IF(field_name = 'value_one',1,0)) AS 'Value One',
  SUM(IF(field_name = 'value_two',1,0)) AS 'Value Two'
FROM table_name

What this does is counts up how many times value_one and value_two appear in field_name in the table table_name.

You can then take this a step further, if you wanted to, and I did…

you can use a line like this within your query:

This gives you the percentage that value_one is of (value_one + value_two).

Hat tip to this stackoverflow answer by eisberg.

Edit: 2014-05-26-21h53m put the final code snippet into a ‘Gist’ on GitHub.

Short list of software I’m using

Just a quick post of some software that I use, that I’ve just discussed with Seth (he knows who he is).

All useful, but the starting point is better task management, so start with Nozbe. PS: also see remapping the CapsLock key.

Truth, Justice and Coffee

We all want to achieve. We want the truth, we want justice. But above all, we want our coffee. Coffee is the fuel that powers our quest for truth and justice. Let the world know that you are in pursuit of truth, justice and coffee by ordering your own tshirt by clicking here to order yours.

Get your tshirt now. Order today. There are no free steak knives.

Get your tshirt now. Order today. There are no free steak knives, only the deep satisfying feeling that comes from knowing you’ve helped.

PS. I wanted a tshirt, but couldn’t find what I was looking for, so I’ve made it here. If the goal is reached (50 tshirts) at teespring, then they’ll make ‘em. Go on, I know you want one, order one for yourself and your neighbour. While you’re at it, get one for your neighbours nephew too.

This offer/campaign ends May 22nd 2014.

Sugar Logic bug with a workaround for date fields

A client is recording the expiry dates of staff blue cards in their SugarCRM database.

So I used the following sugar logic to show if the blue card has expired or not:
ifElse(isBefore(today(),$bluecard_expiry_c),"Current","EXPIRED")

However, the problem here is that when a user of SugarCRM is editing the record, there is a known bug that means it will display “EXPIRED” regardless of if the date is in the past or future.

The workaround for this bug (thanks Anthony) is to wrap the date field in a date(toString($datefield)) bit of code, this transform the original sugar logic into this:

ifElse(isBefore(today(),date(toString($bluecard_expiry_c))),"Current","EXPIRED")

It is essentially force-casting the field to a date field for the javascript-side while passing the formula validator in Studio by first casting the date-type field to a string type.

Which works a treat.

Activate IFTTT SMS Channel on Optus in Australia

How to activate the SMS channel on IFTTT on the Optus network in Australia.

Assuming your mobile number was 0410 123 456.

Drop the leading zero = 410 123 456.
Add the Australian country code 61 to the front = 61 410 123 456.
Add 00 to the front of the number 00 61 410 123 456.
Remove all the spaces = 0061410123456.

Use this number (0061410123456) to active the SMS channel on IFTTT.

Hat tip to @Trail_929 for the pointer.

If this works for you on other networks in Australia, please let me know.

Update 2014-05-12 : I’ve had a few people on Optus Post Paid that haven’t been able to get this to work. It’s worth noting that IFTTT also now has both iOS and Android notification channels available, they may do the trick for you.

Screenshot & screencasts on Mac OSX

Back when I worked exclusively on a Windows machine, I loved using Screenpresso for the ease with which it allowed me to do screenshots and screencasts (if you’re still stuck on Windows, go buy it, it’s worth it).

But now that I’m on a Mac, what to do?

So to start with just press SHIFT-CMD-4 and you can take a screen shot. It’s a native Mac thing.

If you have Dropbox installed go to Preferences | Import and tick the Share screenshots using Dropbox option.

If you want to do screencasts, then fire up QuickTime Player (CMD-SPACE | Quicktime ↩) then press CTRL-CMD-N to start video recording.

That’s how easy it is on a Mac.