Actually making yourself use Minco
by srikanth on 23/03/2012

Minco is a simple tool to track time that integrates quite well with Things if you use iCal to synchronize all the Next Actions.

A problem with Minco is that I tend to forget to actually log my time on Minco. So, I made a small script that I run with cron to check if I’m actually using Minco. It uses Growl to remind me to actually use it. You also need iCalBuddy which is used to check iCal for current events.

#!/bin/bash

dateFrom=`date -v -2M`
dateTo=`date`
eval /usr/local/bin/icalBuddy -ic Minco eventsFrom:'$dateFrom' to:'$dateTo' > tmp
out="`cat tmp`"

if [ -z "$out" ]; then
/usr/bin/osascript <<-EOF
tell application "System Events"
    set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
end tell

if isRunning then
    tell application id "com.Growl.GrowlHelperApp"
        set the allNotificationsList to ¬
            {"Minco"}
        
        set the enabledNotificationsList to ¬
            {"Minco"}
        
        register as application ¬
            "MincoUsage" all notifications allNotificationsList ¬
            default notifications enabledNotificationsList ¬
            icon of application "Script Editor"
        
        --       Send a Notification...
        notify with name ¬
            "Minco" title ¬
            "Track your time" description ¬
            "Y U NO USE MINCO?" application name "MincoUsage"
        
        
    end tell
end if 
EOF
fi

rm tmp

I run the script every two minutes but that might be a little too annoying.