Jake.ch

Thursday, February 19, 2015

Do you remember the Optimus keyboard? It was this cool idea for a keyboard with little screens for each key. If you were in Photoshop it would highlight all the Photoshop shortcuts and stuff like that. It never really came out as a usable product, as far as I know. It was more of a proof of concept that was neat for the time. Alfred Remote essentially is my Optimus keyboard.

You can set up different pages that hold 16 Alfred commands. I have a page just for controlling iTunes. It’s essentially the page that comes with the app, but I added two buttons: Shuffle On and Shuffle Off.

Shuffle On

on alfred_script()
tell application "iTunes"
    tell application "System Events" to perform action "AXPress" of (first menu item of process "iTunes"'s menu bar 1's menu bar item "Controls"'s menu 1's menu item "Shuffle"'s menu 1 whose name ends with "On")
end tell
end alfred_script

Shuffle Off

on alfred_script()
tell application "iTunes"
    tell application "System Events" to perform action "AXPress" of (first menu item of process "iTunes"'s menu bar 1's menu bar item "Controls"'s menu 1's menu item "Shuffle"'s menu 1 whose name ends with "Off")
end tell
end alfred_script

I also have a page for controlling my Mac Mini server, with commands for rebooting various server components and updating the apps without having to VNC or SSH in to my machine.

One of the limitations of Alfred Remote is that it requires you to be on the same network. I get around this by connecting to my Hamachi VPN that my Mac Mini and iPhone are both visible over. Now I am controlling computers from miles away like some sort of magical spell caster.