David Ferguson


Weather Workflow for Alfred 2 (beta) - Coming Soon

Just a teaser for now. I still need to test a few things and don’t have time today, I have a few other things to work on so I should get this completed this week though hopefully.

I may also put out an update to AlfredTweet this week if I get time to work on the authentication stuff some too. It won’t be complete yet, but it will get you by for now.

A Little Secret in Alfred 2 You’ll Like :)

As I was playing around with Alfred 2 beta today to run a few final tests on things before the release, I realized something I could do with him that I’ve been wanting for a while. What is this magical thing? Text Expansion. Goodbye TextExpander, goodbye DashExpander. I no longer need a separate app to do expansions, I can use Alfred. :) Yeah, I could have used Snippets before but this is a little easier. Check it out.

How to set up expansions

Step 1. Create a new workflow for your expansions so we can keep them separate.

Step 2. Create a new “Keyword Input”. Set the keyword to the abbreviation you want to expand. Then set the title and subtitle to the description of the expanded data. Be sure to set the Keyword to have “No argument”


Step 3. Create a “Copy to Clipboard” output action. In the textbox, set type i the text that you want the abbreviation to expand out to and tick the option to automatically paste to the front most app so it will auto paste wherever you are.


Step 4. Save it all, call up Alfred with Cmd+Space or whatever your hotkey it, type the abbreviation, and press enter. Boom! Text expansion in Alfred! 

Obviously this works best if you have abbreviations that won’t show other results too so maybe you could use a , in front or something similar. So for instance, for your email address, use ,mail as the keyword.

A Few Alfred 2 Workflows to Get You Started

So, these may not be top quality yet because I’ve been spending a lot of time figuring things out, learning the ins and outs of the new workflows and such. I wanted to go ahead and share a few just to get you guys started and give you something to look at in the new beta of Alfred. So check these out, let me know if there are any bugs and such. I’ll get things cleaned and such soon.

Also, apologies, I still have a few things to clean up in AlfredTweet. It will be ready soon though, I promise :)

Chrome Bookmark Search

Google Auto Complete


Search Mail.app

Also, sorry about the size of the Rdio extension. It’s from all of the icons. I’ll trim it down soon.

Jan 2

AlfredTweet 2 Authentication

One of the things I hate the most about AlfredTweet is the authentication mechanism. I don’t like that I have to send you to Twitter to log in, grab a code, then make you come back and enter the code into Alfred for storage. Maybe I could use xAuth to authenticate to Twitter to make it a little easier, but I also don’t like the idea of having to ask for your password. I would never do anything malicious like try to steal your password or anything like that, but still.. I wouldn’t feel comfortable just giving my password out in an extension so I don’t really expect you guys to want to do it as well. So how am I going to handle this? Well there are several options and I could potentially offer several in AlfredTweet.

Option 1

The first option is the easiest and that is to just keep the current authentication method. This would keep authentication with Twitter.com. This already works, and I’ve actually done a few things to make it a little bit of a smoother process.

Option 2

This option would consist of me trying to work in xAuth authentication to Twitter. xAuth consists of AlfredTweet getting your username and password to Twitter and sending a request to Twitter.com with that information and getting your auth tokens. Once I get the auth tokens, save them for later and that is what is used to interact with Twitter. As mentioned earlier though, I don’t like the idea of asking for your username and password. One potential solution would be that, instead of asking for your username and password in Alfred, I could use Don Southard’s (@binaryghost. Don’t know him? Follow him now. Seriously, now.) Authenticator app. Using Authenticator would ask for your username and password and store it in your OS X Keychain. I could then use Authenticator to grab the username and password, authenticate to Twitter, grab your auth tokens, save them back to the keychain and then delete the keys that have your username and password in them. So this just gives you a secure way of entering your username and password until I get done with the authentication. This isn’t exactly my preferred method but, I want to make things easy for you guys.

Option 3

This is my favorite method, but it has a downside. This method requires Mountain Lion. This option will request keychain access and check to see if you have your auth tokens stored in the keychain already. Why would they be in there? The Twitter integration that is baked into OS X stores your auth tokens in the keychain. So, if you had your Twitter account set up in Mountain Lion you could simply perform a “local authentication” that would grab your auth tokens from the keychain and be done. No website, no entering in codes, usernames, passwords, etc. There would only be a prompt saying that I wanted to grab the info from your keychain and then setup is complete. 


What would you like to see or what would you prefer? Send a tweet, let me know.

Jan 1

Wunderlist 2 for Alfred Info

Don’t get excited just yet. I just wanted to write a little note to let you guys know that I am working on getting this working again. The old version of Wunderlist used a local SQLite database that was named differently and I believe in the different location than the new database. I’ve been poking around at it this morning. The new database is located at ~/Library/Application Support/Wunderlist/WKModel.sqlite if you want to look at it as well. Obviously, be careful :) Task and list information is stored in the ZRESOURCE table with the ZCLIENTID field making the distinction between the two types. You can query the tasks locally using sqlite3 by doing something like this at a prompt.

sqlite3 ~/Library/Application\ Support/Wunderlist/WKModel.sqlite “select a.Z_PK, a.ZTITLE, b.ZTITLE from ZRESOURCE as a JOIN ZRESOURCE as b where a.ZCLIENTID like ‘%:Task:%’ and b.Z_PK = a.ZTASKLIST”

That would give you a list of all tasks (even completed) along with their id and the name of the list they belong to. Hopefully when Alfred 2 comes out I can use stuff like this to populate the result list and allow you to action results like this.

If you wanted to only grab a list of items that have not been completed you could add one extra clause to the query. It would be modified to be..

sqlite3 ~/Library/Application\ Support/Wunderlist/WKModel.sqlite “select a.Z_PK, a.ZTITLE, b.ZTITLE from ZRESOURCE as a JOIN ZRESOURCE as b where a.ZCLIENTID like ‘%:Task:%’ and b.Z_PK = a.ZTASKLIST and a.ZCOMPLETEDAT is null”

Anyway, just wanted to let you guys know that I am looking at it and am going to contact someone in the Wunderlist team. They keep referencing an api.. I want access to it :)

Also, one last note, once again, this is directly editing the sqlite database that Wunderlist uses and therefore, when you change something, it isn’t reflected in Wunderlist if it is open. It won’t show up until Wunderlist is restarted. That’s one of the reasons I would like to get api access so I can hopefully find a better path to integrate with Wunderlist and get things working a little more smoothly.

New Add to Pocket from Alfred

I quickly made a new extension to send links to your Pocket account from Alfred today. This extension requires the most recent update to Pocket for Mac to work. This extension is a little different than the other because it actually uses the native app to add the url and not the web service. The most recent update to  Pocket for Mac added a new url scheme pocket:// that allows for adding urls natively. 

I havne’t done a lot of thorough testing on it so if there’s an issue with it, let me know and I’ll get it fixed asap.

Download it here

PHP Extension Utils

So I know I am probably a rare bird and probably one of the few people that actually make Alfred extensions from PHP scripts. I like PHP, it’s powerful, it has functions to do everything under the sun, and there’s tons of documentation and examples in case you run into something you’re unsure how to accomplish.

I find myself recreating the same functions and doing a lot of the same things in a lot of my extensions so I decided to build a little PHP class that I can include and start reusing to perform a lot of the tedious things that I reuse over and over. I’ve made several functions so far that I can use to: execute cURL, convert arrays to XML, convert JSON to XML, read data from a plist, save an array of data to a plist, etc. I’m going to continue adding functionality to this and will eventually put it up on github or something similar as well for other people to add to, correct, etc. I’ll also post it for people to download it and use in their projects or extensions. If you develop extensions in PHP as well, what other functions do you think would be useful when creating extensions in Alfred? Send me some recommendations on Twitter (@jdfwarrior). I’d love to hear what you guys think.

I may go back at some point and try to built something similar in Python as well. I may even learn a little ruby or something so I can make the library available for developers of several different languages. If you are fluent in some of these languages, perhaps you could get in touch with me and help me get a jump start on this. If you want to help out, once again, get ahold of me on Twitter or email (jdfwarrior at gmail).

Sep 3

Flickering Scroll from jQuery scrollTo Plugin on iOS

This isn’t one of my normal posts but it’s something I had to look up and I found the result of how to fix it somewhere, but it wasn’t clearly marked (at least not where I found it) so I thought I would throw it up on here really quick just to document it and potentially help someone else.

I’ve been using Ariel Flesler’s jQuery.scrollTo plugin for a little project I’m working on and I noticed that it looks and works great on my desktop browsers but if you view it on an iOS device (iPhone/iPad), the scrolling flickers and appears to jump (I haven’t tested this when scrolling on all angles, only vertical scroll). I found several proposed solutions but they essentially involved not using scrollTo. I found one comment on a page that didn’t seem to even get much attention but solved the issue. You have to specify the axis that you want to scroll on. So in my example, since I’m only scrolling vertically, I had to specify that I was only scrolling on the y axis and not on x. It’s simple too add this, you just specify your axis in the properties when you call the plugin. 


$.scrollTo(“#object”, 800, {axis: ‘y’});

This fixed the flickering and the scrolling works perfectly now. Hope this helps someone else out.

Searching Transmit Favorites with Alfred

I noticed on the Alfred Get Satisfaction page that there is a post about wanting to search Transmit favorites in Alfred. I had made an AppleScript before that would open a favorite but the downside to that was that it had to be typed exactly. This extension will allow you to actually search the favorites and the connect history of Transmit in Alfred.

The keyword for the extension is “ftp”. This can be changed of course. To search your favorites type “ftp <search term>”. Results show up in the Alfred results list.

Download it here

Searching Email with Alfred

A lot of people forget about the ability to create search filters in Alfred. They can be really powerful. Vero (@vero) got me to look at one a bit ago for searching Outlook. After getting it created, I wondered if I could do the same thing with Mail.app since what I default to since SPARROW SOLD OUT. Sorry :) Anyway, here are the two filter extensions for searching Mail and Outlook.

These should allow you to search your client of choice by subject, author name, author email, or within the content.

I may end up looking at a few other mail clients to do the same thing. Or, if someone else beats me to one, let me know and I’ll add it (the link) to this post and credit the author for it.

Download Outlook Mail Search

Download Mail.app Mail Search

Searching Notes with Alfred

Want a quick way to search Notes.app notes from Alfred? Create a Search Filter extension.

If you create a Search Filter extension that only shows results of the .notesexternalrecord file type, and then add kMDItemTextContent as an additional metadata field, you can easily search your Notes directly from Alfred. When you press Enter, the note will be opened in a stand alone window (see the screenshot above).

If you aren’t sure how to add the metadata field (it allows Alfred to search the file contents as well, not just the title), then don’t worry. Click here to download a pre-made filter. ‘Notes’ is the filter’s keyword. 

PS. Don’t forget the bacon.

Syncing and searching Pinboard bookmarks in Alfred.

More info to come.. I may finish this and pass it off to @binaryghost for distribution with his Mac app, Thumbtack. For more info on Thumbtack, check it out on Twitter (@thumbtackapp) or visit Thumbtackapp.com

Creating reminders in the Mountain Lion Reminders app via Alfred.

It’s not 100% natural language because it has to have a period to separate the task and the reminder time and it also gets a little quirky on the times (depending on what you enter), but it works for the most part. It works for times like “20 minutes” as well.


Chrome Bookmark Import for Alfred

Chrome Bookmark Import for Alfred

This extension is one of two that I will be releasing to work with Chrome bookmarks. This one will read your Chrome bookmarks and will import all of those URLs into the URL / History function of Alfred.  This may sound like a silly extension but it’s purpose is to make it so that Alfred will search Chrome bookmarks since Alfred only currently supports Safari bookmarks. This extension will need to be run occasionally if you want to keep it up to date. 

The other extension that I am working on will let you sync all your Chrome bookmarks into Safari and will allow you to set an interval on which the script runs and updates the bookmarks so your Chrome bookmarks will always be searchable by Alfred.


This extension works on a set path. If you are using a different Chrome profile or the path for the Alfred for the Alfred history database is somehow different, you will need to find that path to those files and adjust their path in the script.php file. The path to the two objects is at the top of the php file.


Plex Media Server (PMS) auto update not finding media?

The Problem

Not too long ago I setup SickBeard and SABNzb. Everything works wonderfully. It grabs all my tv shows automatically, renames them, puts them in the appropriate folders that Plex Media Server (PMS) is supposed to scan and find changes and auto add the content to my library. For some reason though, it doesn’t always work.

After searching through the Plex forums and other places online, I’ve found that the most common answer is to do a deep refresh. By default, Plex runs a Turbo Scan. From my understanding, it simply scans the folders in your library and checks their modified date. If that date has changed, then Plex will update that folder. A deep scan will scan the contents of the folder regardless of the modified date. For some reason, Plex Media Server isn’t detecting the changes when content is added from SABNzb and SickBeard. Running a deep scan always seems to find the new content and add it to the library. The only problem with that though is that you can’t set PMS to run a deep scan by default as opposed to the turbo scan. You have to manually run a deep scan by holding Option and clicking the Refresh button in PMS. What’s wrong with that? It requires an action from me. I set up SABNzb and SickBeard so I could have it ALL automated, not just the majority.

The Solution

I’ve been playing around with launchd some this week for another Alfred extension to automatically sync bookmarks from Chrome back to Safari for searching with Alfred. PMS is set to automatically scan the folders for changes every 15 minutes. Why couldn’t I just find a way to automate a deep scan with launchd? You can. :)

I’ve got a little package working right now that you unzip and place in a folder. It can be any folder of your choice, but if you put it somewhere other than ~/Documents/Plex Deep Scanner, then you will have to go in and change the path to the files by hand. It’s not hard. Anyway, this little package comes with a launchd plist file, a scan.sh script, GrowlNotify so you can see when things are occurring, and a few other small scripts to install the plist, or to start/stop the script.

Basically, the plist tells launchd to run the scan.sh script every 15 minutes. The scan.sh script calls PMS from the command line and tells it to run a deep scan on my tv shows section in PMS. It can be modified to do my movies too. I just haven’t decided yet if I want that to be a separate script or to have them but run together.

If anybody is interested in more details or would like to try this setup, let me know and I can package it up and share it.