Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As far as I know, Apple provides a free (as in zero-cost) <a href="http://developer.apple.com/sdk/" rel="nofollow noreferrer">SDK</a> for <code>iTunes</code> Visual Plug-Ins for both OS X and Windows. If you can't get what you need through that, you <em>could</em> always use iTunes Apple Events scripting interface to monitor via polling from another OS X app using an OSA-compatible interface such as AppleScript or <a href="http://appscript.sourceforge.net/" rel="nofollow noreferrer">appscript</a> with Python, Ruby, or Objective-C. That may not be what you'd like but it is documented and supported.</p> <p>For example, with py-appscript, here's how to access the current track and the those in the recently played smartlist:</p> <pre><code>&gt;&gt;&gt; from appscript import * &gt;&gt;&gt; it = app('iTunes') &gt;&gt;&gt; it.current_track.rating() # 40 == 2 stars 40 &gt;&gt;&gt; len(it.playlists['Recently Played'].tracks()) 80 &gt;&gt;&gt; it.playlists['Recently Played'].tracks[1].rating() 40 &gt;&gt;&gt; it.playlists['Recently Played'].tracks[1].rating.set(to=100) &gt;&gt;&gt; it.playlists['Recently Played'].tracks[1].rating() # 100 = 5 stars 100 </code></pre> <p>It's also possible to filter on various metadata fields (open the iTunes.app scripting definition in the AppleScript Script Editor to browse):</p> <pre><code>&gt;&gt;&gt; import datetime &gt;&gt;&gt; an_hour_ago = datetime.datetime.now() - datetime.timedelta(hours=1) &gt;&gt;&gt; it.playlists['Library'].tracks[its.modification_date &gt;= an_hour_ago]() [app(u'/Applications/iTunes.app').sources.ID(45).library_playlists.ID(49347).file_tracks.ID(72017)] </code></pre> <p>But note that changes to ratings do not appear to affect the modification date.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload