AlfredRun, a URL Scheme for Alfred

Saturday, February 15, 2014

This is a fork of a project by Chase Nordengren

Enables the use of a custom URL scheme to run commands in Alfred 2 (OS X).


Code based on a template by Drosophiliac.


Move compiled Applescript Bundle Alfred Run.app into your /Applications folder.


Run the URL scheme “alfredrun://foo” from any browser, where ‘foo’ refers to a command in Alfred. Use “%20” to preseve spaces in command.

Example: alfredrun://foo%20bar%20bat

Advanced Usage Ideas:

Alfred commands can be run remotely using an iOS application like Command-C, perhaps saving frequently used commands in Launch Center Pro. To preserve spaces in commands in Launch Center Pro, wrap the text of the alfred command in double curly brakets, and break spaces with “%20”.


Example with Prompt:

iOS Bookmarklet, handy for those who do not use Launch Center Pro

Simple, just add this as a bookmark’s location. - Don’t forget to add your device name! (url encoded)

Build your own using PHP - Don’t forget to add your device name! (It will url encode for you)

    echo 'javascript:' . rawurlencode("var deviceName='YOURCOMPUTERNAME',yourCommand=window.prompt('Alfred Run');location.href='command-c://x-callback-url/copyAndOpenURL?deviceName='+encodeURIComponent(deviceName)+'&url=alfredrun://'+encodeURIComponent(encodeURIComponent(yourCommand));");