Alfred workflow: IP addresses
07 Jul 2013
One of my long-standing feature requests for Alfred was always an ability to generate arbitrary results for a given keyword. That would allow you to input a keyword, have a script run in the background, and then get a set of results based on the output of the script.
The main reason I always wanted this was to make it easier to get a list of the computer’s IP addresses. Alfred seemed like the perfect place for that kind of functionality. Lots of solutions existed for doing this in version 1 of Alfred, but generally they just copied the IP to the clipboard, or displayed it as a notificaiton.
With Alfred 2’s workflows, a much more elegent solution is possible. We now have the ability to build specific results for a keyword programmatically.
This workflow lists out the IP addresses for all of the machine’s interfaces (real and virtual), and it hits an outside service (over HTTPS) to get the external IP as well. Selecting one of them from the list will copy that IP to your clipboard.