Quickly made gui for C*mus-remote on OSX

There’s some sample of AppleScript code that summon cmus-remote to make a working gui interface to control cmus.

— Toggle pause/play:

set cmuscmd to "/usr/local/bin/cmus-remote "
do shell script cmuscmd & "--pause"

— Toggle Continue:

set cmuscmd to "/usr/local/bin/cmus-remote "
do shell script cmuscmd & "-C 'toggle continue'"

many instances of cmus-remote in the same code…
— Toggle Continue then Play: (useful for relaunching cmus after a toggle continue break)

set cmuscmd to "/usr/local/bin/cmus-remote "
do shell script cmuscmd & "--play"
do shell script cmuscmd & "-C 'toggle continue'"

With little bash scripts launched by an AppleScript with the same code works pretty well too, if your cmus daemon is in another machine for example.

you can put this inside the Manytrick’s Butler as well. (it’s one of me most useful software on OSX I’ve ever had.) (ºωº)

AppleScript is an awful language, not practical at all, which has no documentation on how to link variables to command line softwares. But here it’s quicker than making a full interface with Qt.

Advertisements