Jake.codes

AlfredRun Bookmarklet

Saturday, February 15, 2014

Use Command-C and AlfredRun to control Alfred on your Mac through this handy bookmarklet for your iOS device.

Bookmarklet

javascript:var%20deviceName%3D%27YOURCOMPUTERNAME%27%2CyourCommand%3Dwindow.prompt%28%27AlfredRun%27%29%3Blocation.href%3D%27command-c%3A%2F%2Fx-callback-url%2FcopyAndOpenURL%3FdeviceName%3D%27%2BencodeURIComponent%28deviceName%29%2B%27%26url%3Dalfredrun%3A%2F%2F%27%2BencodeURIComponent%28encodeURIComponent%28yourCommand%29%29%3B

PHP Builder

<?
    // Build your own bookmarklet using PHP
    // just remember to set your deviceName
    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));");
?>