Album art is integrated, but as an NSAppleScript right now. Must switch
[MenuTunes.git] / iTunesRemote.m
index d41f3bd..3c1ce75 100755 (executable)
 
 - (NSImage *)currentSongAlbumArt
 {
-    return nil;
+    NSAppleScript *script;
+    NSAppleEventDescriptor *moof;
+    NSData  *data;
+    script = [[NSAppleScript alloc] initWithSource:@"tell application \"iTunes\"\nget data of artwork 1 of current track\nend tell"];
+    moof = [script executeAndReturnError:nil];
+    data = [moof data];
+    if (data) {
+        return [[[NSImage alloc] initWithData:data] autorelease];
+    } else {
+        return nil;
+    }
 }
 
 - (float)currentSongRating