{"id":2840,"date":"2012-11-29T14:31:59","date_gmt":"2012-11-29T19:31:59","guid":{"rendered":"http:\/\/www.red-sweater.com\/blog\/?p=2840"},"modified":"2012-11-30T09:56:31","modified_gmt":"2012-11-30T14:56:31","slug":"toggle-itunes-11-miniplayer","status":"publish","type":"post","link":"https:\/\/redsweater.com\/blog\/2840\/toggle-itunes-11-miniplayer","title":{"rendered":"Toggle iTunes 11 MiniPlayer"},"content":{"rendered":"<p>Today,\u00a0<a href=\"http:\/\/www.apple.com\/itunes\/\">Apple released iTunes 11<\/a>, the anticipated update that has been due &#8220;sometime in November&#8221; since they announced it earlier this year. Judging from reactions on Twitter it&#8217;s having a mixed response: the new UI is, as expected, either refreshing or distressing depending on your particular attachment to the old look-and-feel, and the extent to which the new look speaks to you.<\/p>\n<p>Folks who use <a href=\"http:\/\/www.red-sweater.com\/fastscripts\/\">FastScripts<\/a> or another utility to script iTunes will be pleased to know that much of its scriptability is unchanged. I&#8217;m able to use my variety of scripts for playing and pausing, showing track information, etc., without any issue. But some subtle things have changed, including support for minimizing or maximizing the iTunes window. My friend Gabriel Roth framed the problem on Twitter:<\/p>\n<blockquote class=\"twitter-tweet\" data-in-reply-to=\"274225331777445888\">\n<p>@<a href=\"https:\/\/twitter.com\/danielpunkass\">danielpunkass<\/a> Seems iT11 breaks the AppleScript \u201cminimized\u201d property\u2014it now means \u201cshrunk in the Dock\u201d rather than \u201cin mini player state.\u201d<\/p>\n<p>\u2014 Gabriel Roth (@gabrielroth) <a href=\"https:\/\/twitter.com\/gabrielroth\/status\/274227970053382144\" data-datetime=\"2012-11-29T19:06:57+00:00\">November 29, 2012<\/a><\/p><\/blockquote>\n<p>\n<script type=\"text\/javascript\" src=\"\/\/platform.twitter.com\/widgets.js\"><\/script><br \/>\nI scratched my head about a proper workaround for this. Indeed, not only does the minimized property behave differently than documented in the scripting dictionary, the new &#8220;MiniPlayer&#8221; is an independent window from the main window. Although they seem to toggle between one another, you can actually select and make both visible from the &#8220;Window&#8221; menu in iTunes.<\/p>\n<p>My first thought was to simply hide one window while making the other visible. This would be a fine solution except another bug in iTunes 11 apparently prevents the new MiniPlayer window from being exposed to the scripting object hierarchy.<\/p>\n<p>So the compromise is to resort to UI scripting. By simulating the selection of iTunes&#8217;s own &#8220;Switch&#8221; menu item, we can rest assured that the toggle will happen as naturally as possible given the constraints we are facing.<\/p>\n<p>Download\u00a0the <a href=\"http:\/\/red-sweater.com\/AppleScript\/ToggleiTunesMiniPlayer.zip\">Toggle iTunes MiniPlayer<\/a> script if you interested in hooking up a hotkey or otherwise automating display of the iTunes 11 MiniPlayer.<\/p>\n<p><strong>Update:<\/strong>\u00a0Doug Adams (of <a href=\"http:\/\/dougscripts.com\/itunes\/\">Dougscripts.com<\/a> fame) pointed out in the comments that my original solution was less ideal because scripters on non-English systems would need to open and modify the script to search for the correctly named item. I was able to update the script to search instead for the item by its keyboard shortcut alone. This should make the script more immediately useful to users of iTunes 11 regardless of the primary language they run their Mac with.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today,\u00a0Apple released iTunes 11, the anticipated update that has been due &#8220;sometime in November&#8221; since they announced it earlier this year. Judging from reactions on Twitter it&#8217;s having a mixed response: the new UI is, as expected, either refreshing or distressing depending on your particular attachment to the old look-and-feel, and the extent to which [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,6],"tags":[],"class_list":["post-2840","post","type-post","status-publish","format-standard","hentry","category-applescript","category-fastscripts"],"_links":{"self":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/2840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/comments?post=2840"}],"version-history":[{"count":2,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/2840\/revisions"}],"predecessor-version":[{"id":2842,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/2840\/revisions\/2842"}],"wp:attachment":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/media?parent=2840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/categories?post=2840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/tags?post=2840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}