See, for example, this post on the Alfred forums, and the linked workflow (which I use from time to time).
Stephen