Work and Rest

Here’s a quick Alfred workflow I made up to handle starting and ending the workday.

alfred_workflow

There are two commands. Both are just super simple AppleScripts:

Work

  1. Enabled work-related IM accounts
  2. Enabled work-related Mail accounts
  3. Activate OmniFocus
  4. Activate Calendar
  5. Activate Skype
  6. Fire notification

Rest

  1. Disable work-related IM accounts
  2. Disable work-related Mail accounts
  3. Quit OmniFocus
  4. Quit Calendar
  5. Quit Skype
  6. Fire notification

 

Push All the Remotes!

I know I can do all this via the command line, but I use a Mac because I have the power of a command line with an elegant UI. So, in light of that, I use and enjoy Tower. Here is a new automation workflow for Alfred that helps make Tower more powerful.

I recently asked Tower if it would be possible to push to all remotes a the same time, or if there was additional entries being added to the AppleScript dictionary I could use for this. Unfortunately it’s not possible but thankfully AppleScript still allows you to control UI elements as well!

all_the_remotes

This isn’t as elegant as a natively built-in feature but will definitely do the trick until such day as this feature can be included. Thank you AppleScript and Alfred!

Download the Alfred workflow

The video only demonstrates pushing to remotes, but I included a workflow to pull from all remotes as well.

A Far More Direct Siri Blog Publishing Method

Previously I set up a Rube Goldberg method of publishing my Jekyll-based blog via Siri. Here’s a more streamlined update.

Every step in the process is a potential breaking point. Fortunately, the two biggest that were breaking on me are also fairly simple to replace. IFTTT works great, but wasn’t always real-time. Dropbox had a major outage this week that meant it couldn’t be used at all. I replaced both of them with a far more direct AppleScript:

The basic concept is the same, only now instead of creating an IFTTT rule to generate a text file on Dropbox that gets synced to my Mac mini where Hazel notices it and fires off an AppleScript …

… I have an AppleScript that checks Reminders.app directly and put it on a launchd job to check every 15 seconds, similar to the process I set up in my post Create Reminder Tasks from Email. Now I’m keying directly off of Reminders.app and have the same flexibility to add new automation tasks at any point.

Create Reminder Tasks from Email

For a while I’ve wanted to be able to add emails to whatever task manager I’m using, from any device I’m using. Currently I’m keeping things simple by using the default Reminders app for OSX and iOS, but this solution could work for any task management app that has an OSX counterpart and supports AppleScript.

I didn’t come up with this script entirely on my own, but I did customize it, alter the overall workflow, and work through some Gmail + Mavericks issues (now I’m starting to understand why Gmail’s IMAP bastardization is a real pain).

The process is pretty simple:

  1. Flag an email you want to have turned into a task
  2. Archive the email 1
  3. Go about your business

On my Mac mini I have running at home, I set up Reminders (already set up from my crazy Siri-controlled Blog Publishing post) and Mail.app with my standard email accounts configured.

The key piece is the AppleScript that takes all flagged emails, creates a Reminders task out of them, and then un-flags them. Here it is:

That will check all enabled accounts. If you want to only process one account you’ll have to modify the script a bit. You can adjust what goes in the notes field as well if you want (msgBody). I opted to copy in the text of the entire email in case I needed to reference it while I was on the go. The link to the original email is at the bottom, but that only works on OSX. I also tried to keep the From text short (and stripped out the email address) so that the display in Reminders is more readable.

To get the AppleScript running periodically to check do this task you’ll need to set it up to run via launchd or cron. I’m more familiar with cron, but it seems as though Apple leaning towards launchd and adding additional functionalities. I figured this would be a good simple task to learn launchd on so I’ll have it in my toolbelt for later on.

What you need to do is create a new .plist file in ~/Library/LaunchAgents . Mine is named com.nateofnine.FlaggedEmailToReminders.plist  and looks like this:

Now all you need to do is log out and back in and this will start executing your AppleScript every 60 seconds!