Omnifocus Daily Task Email with Flagged, Inbox and Context options

I’ve been using Omnifocus as my task manager for almost a year on the mac and iOS. Working in a sixth form college where all the machines are Windows I wanted a way to easily see what tasks were on my list for that day without having to get an iOS device out.

Like many, the first thing I check in the morning is my email, and, better still, email is something that I could access on a Windows machine. The one thing that I wished was available was the ability to have a daily digest email of the tasks that I need to complete that day. I started to investigate the options out there that didn’t involve migrating away from omnifocus.

Screen Shot 2016-07-28 at 19.38.04

The daily HTML email.

There are a couple of scripts around the internet that aim to provide some of this functionality. However, none of these fitted what I wanted from a daily digest email and my wishlist included the ability to list:

  • outstanding actions by project
  • actions due that day by project
  • flagged actions
  • any actions that had my ASAP context (I use this as a step down from ‘flagged’ must be done)
  • my Inbox actions that need processing

My Daily Email Script

Using the scripts by Ben Waldie (via Engadget) and Ben Brooks (via Brooksreview) as a starting point, I have put together a script that does all of the above and sends it out in a relatively pretty HTML email.

This is the first applescript that I’ve written. I’m much more at home in PHP so I can’t make any promises that it will work for everyone, or that it is the best way to achieve the above. But it works. I have uploaded the script to github where anyone can download it, improve on it, or just use it to get the daily email.

The main features of the script are that it lists:

  • flagged messages with due date
  • inbox tasks with due date
  • outstanding and due today tasks by project with notes if there (length of note can be limited)
  • tasks in any named context (context can be named)

There are a few options on the script so that you can choose what you want to be sent out in the daily email. Hopefully this will save a few others some time. All you need to do is set up your mac to trigger the script daily. There are a few options for this, from using iCal to trigger the script, to third party software. I’ll let you decide which way is best for you.

If you use it, let me know how it works. If you find any bugs, let me know and I’ll try to fix them and if you improve it, share it.githubLink

Issues?

When I run the script the email message isn’t coming through:

  • it could be an issue with the mail settings. This page might help.
  • you might also need to set up postfix to use Gmail SMTP settings – there is a project here to help (thanks to Barbaros for this).

 

Featured image from https://brettkelly.org/why-omnifocus/

I’m Resourcd. Are you?

What’s Resourcd?

Six years ago in October 2007 we started a fledgling resource sharing site called PsychExchange.co.uk with the idea of helping teachers help teachers and create an amazing community where the sharing of ideas, videos and resources was made possible.  Over the following years we have created more of these communities for Sociology, PE, Science, Law, Health and Social Care and Film and Media.  These have provided to be just as successful and full of teachers sharing.

We are thrilled to announce that as of Easter 2013 we will be combining all of the sites into one exciting community of over 200,000 users who have uploaded almost 20,000 resources and shared 5 million files. This new community is called resourcd and will be found at resourcd.com.

What does this mean for you?

From Easter you will need to update any bookmarks for the exchange site that you visit to resourcd.com. All of your comments, files, videos and ideas will be moved across and you will be able to log in with the same details that you have always used.  On your first visit to the site you can choose the subjects that you are interested – that way if you only teach Psychology you won’t be bombarded with Law and PE files, and as a Science teacher you don’t have to see all the Psychology and Health and Social Care resources.

For our current PLUS! members, as a big thank you for your support over the years, you will get community wide access to all of the PLUS! features for the duration of your membership for no extra cost. Thanks!

The new stuff …

Along with all the usual things that you know-and-love about your exchange site we will also have a new blog with teaching ideas, reviews, discussions and features, an updated design and loads of extra features across the site especially for the PLUS! members.

I want to be Resourcd.

If you are interested in writing for the new Resourcd blog, either a large feature article or a small ‘thought of the day’ then do get in-touch. For every feature article that we publish we will send you a £10 amazon gift certificate as a thank you and it is a great way to get your name out there to a massive community of teachers.  For more information on writing for us either email moc.dcruosernull@golb.

follow-us-twitter-facebook

We are social so follow us on twitter and facebook to get the most up-to-date information on the changes and when we are going live. Find us on Twitter @imresourcd or like us on facebook.com/resourcd to keep up-to-date with Resourcd.

Vanilla forum: MySQL sockets installation

This morning I wanted to hack around with Vanilla forums and convert a phpBB 3 installation over to it. After several attempts at the installer I found that I couldn’t run it ‘as is’ on my 1&1 managed server. The issue is that Vanilla’s PDO connection method has been written to only work with host access (such as localhost, or 127.0.0.1) rather than socket access (see http://www.php.net/manual/en/ref.pdo-mysql.connection.php). To get it working using a socket like: localhost:/tmp/mysql5.sock took a little hacking around in the code. Here is a wee how-to for anyone else that might come across the same problem.

There are two files that you need to be edit before you start the install:

library/core/functions.general.php
library/database/class.database.php

First open library/core/functions.general.php and find the function called GetConnectionString (I found it on line 680). It looks like this:

if (!function_exists('GetConnectionString')) {
   function GetConnectionString($DatabaseName, $HostName = 'localhost', $ServerType = 'mysql') {
      $HostName = explode(':', $HostName);
      $Port = count($HostName) == 2 ? $HostName[1] : '';
      $HostName = $HostName[0];
      $String = $ServerType.':host='.$HostName;
      if ($Port != '')
         $String .= ';port='.$Port;
      return $String .= ';dbname='.$DatabaseName;
   }
}

A simple change to the code here is to change the line:

      $String = $ServerType.':host='.$HostName;

to:

      $String = $ServerType.':unix_socket='.$HostName;

Save the file. This will ensure that you can run the install. Now you need to make sure that following the install you can point to the right database.

Moving on to the library/database/class.database.php file open this and look for the following code (line 183-195):

if(!isset($Dbname)) {
  $Dsn = $DefaultConfig['Dsn'];
} else {
  if(empty($Port)) {
    // Was the port explicitly defined with the host name? (ie. 127.0.0.1:3306)
    $Host = explode(':', $Host);
    $Port = count($Host) == 2 ? $Host[1] : '';
    $Host = $Host[0];
  }
 
  if(empty($Port)) {
    $Dsn = sprintf('host=%s;dbname=%s;', $Host, $Dbname);
  } else {
    $Dsn = sprintf('host=%s;port=%s;dbname=%s;', $Host, $Port, $Dbname);
  }
}

The initial if(!$Port) conditional needs to be commented out (or removed) and the second one needs the host changing to unix_socket. When you’re done it will look like this:

if(!isset($Dbname)) {
  $Dsn = $DefaultConfig['Dsn'];
} else {
  /* **This could be deleted**  if(empty($Port)) {
    // Was the port explicitly defined with the host name? (ie. 127.0.0.1:3306)
    $Host = explode(':', $Host);
    $Port = count($Host) == 2 ? $Host[1] : '';
    $Host = $Host[0];
  }  ** Stop deleting here */
 
  if(empty($Port)) {
    $Dsn = sprintf('unix_socket=%s;dbname=%s;', $Host, $Dbname);
  } else {
    $Dsn = sprintf('unix_socket=%s;port=%s;dbname=%s;', $Host, $Port, $Dbname);
  }
}

When this is done go to the install page and complete all your database access details as normal, until you come to the host. You need to remove localhost from your host; it should look something like /tmp/mysql5.sock rather than localhost:/tmp/mysql5.sock.

The possible issue with this is that you will not be able use this hack if you’re running MySQL on a non-default port (anything other than 3306) as we have just removed the code that Vanilla uses to strip the port number from the host.

Enjoy!

Disclaimer: This worked for me. I can’t guarantee that it will for you. It’s never a great idea to start playing around with code so if you break anything it’s not my fault!

SlideShare API without url_file_open

Recently while writing some code that utilised the SlideShare API I found myself on a server which had url_file_open turned off in the php.ini and this couldn’t be over-ridden with a .htaccess file either. So I had to re-write the code which used file_get_contents using the cURL library.

I needed to replace the get_data function within the SSUtil.php file (part of the SlideShare PHP kit). Initially it looked like this:

private function get_data($call,$params) {
	$ts=time();
	$hash=sha1($this->secret.$ts);
	try {
		$res=file_get_contents($this->apiurl.$call."?api_key=$this->key&ts=$ts&hash=$hash".$params);
	} catch (Exception $e) {
	// Log the exception and return $res as blank
	}
	return utf8_encode($res);
}

Following some time spent with google and a bit or trial-and-error I came up with this which seems to work in its place:

private function get_data($call,$params) {
	$timeout=0;
	$ts=time();
	$hash=sha1($this->secret.$ts);
	# use CURL library to fetch remote file
	try {
		$ch = curl_init();
		$url = $this->apiurl.$call."?api_key=$this->key&ts=$ts&hash=$hash".$params;
		curl_setopt ($ch, CURLOPT_URL, $url);
		curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
		$this->file_contents = curl_exec($ch);
		$res = $this->file_contents;	
	} catch (Exception $e) {
		// Log the exception and return $res as blank
	}
	return utf8_encode($res);
}

So, for any other unlucky souls who find themselves on a server which doesn’t support url_file_open then there you are.