Skip to content

Instantly share code, notes, and snippets.

@dtinth
Created August 15, 2011 16:05
Show Gist options
  • Save dtinth/1147065 to your computer and use it in GitHub Desktop.
Save dtinth/1147065 to your computer and use it in GitHub Desktop.
Get currently playing track.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main() {
execl("/usr/bin/osascript", "osascript",
"-e", "tell the application \"iTunes\" to get (the name of current track) & \" ----- \" & (the artist of current track) as string", NULL);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment