{"id":3601,"date":"2014-03-29T06:06:29","date_gmt":"2014-03-29T06:06:29","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/spotify-applescript-strange-artwork-behaviour-and-unexpected-spotifyimagedata-collection-of-common-programming-errors\/"},"modified":"2014-03-29T06:06:29","modified_gmt":"2014-03-29T06:06:29","slug":"spotify-applescript-strange-artwork-behaviour-and-unexpected-spotifyimagedata-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/spotify-applescript-strange-artwork-behaviour-and-unexpected-spotifyimagedata-collection-of-common-programming-errors\/","title":{"rendered":"Spotify AppleScript strange artwork behaviour and unexpected SpotifyImageData-Collection of common programming errors"},"content":{"rendered":"<p>I use Scripting Bridge (Cocoa) to access AppleScript methods and properties of Spotify. For example, I need to access artwork of the current playing track.<\/p>\n<p>On the most of my machines Spotify pushes an ordinary instance of <code>NSImage<\/code> class, which I can access via something like <code>[[spotifyApp currentTrack] artwork]<\/code>, and everything works as expected.<\/p>\n<p>But on the one of my machines and one friend&#8217;s machine-instead of an instance of <code>NSImage<\/code> class-I get very strange <code>SpotifyImageData<\/code> by calling still the same <code>[[spotifyApp currentTrack] artwork]<\/code>. This class has no methods (I tried to search for those methods via Objective-C runtime mechanisms) and no properties. I cannot use it as <code>NSImage<\/code>, because it is <em>not<\/em> an image, in fact. What is it? How should I handle it? This strange bug appeared only in the latest releases of Spotify and had not been spotted in previous releases.<\/p>\n<p>All my machines have got the same version of OS X and the same latest version of Spotify installed. Also, no third-party system-wide utilities are being used on my Macs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use Scripting Bridge (Cocoa) to access AppleScript methods and properties of Spotify. For example, I need to access artwork of the current playing track. On the most of my machines Spotify pushes an ordinary instance of NSImage class, which I can access via something like [[spotifyApp currentTrack] artwork], and everything works as expected. But [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3601","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3601"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3601\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}