Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing a Track Name in iTunes via iTunes' plist (XML) File
    text
    copied!<p>I've learned that iTunes XML file is actually a plist, and instead of trying to parse the raw XML, I could use property lists.</p> <p>I'm able to access the "Tracks" section, but I'm able to unable to do anything simple like extracting a track name. Admittedly, I'm stumbling around a bit, but this is the code I've gotten to so far: </p> <pre><code>tell application "System Events" tell property list file property_file tell contents set my_tracks to value of property list item "Tracks" repeat with t in my_tracks set theName to value of property list item "Name" of t display dialog theName end repeat end tell end tell end tell </code></pre> <p>Any pointers as to what I'm doing wrong?</p> <p>If it helps, sample XML:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple. com/DTDs/PropertyList-1.0.dtd"&gt; &lt;plist version="1.0"&gt; &lt;dict&gt; &lt;key&gt;Major Version&lt;/key&gt;&lt;integer&gt;1&lt;/integer&gt; &lt;key&gt;Minor Version&lt;/key&gt;&lt;integer&gt;1&lt;/integer&gt; &lt;key&gt;Application Version&lt;/key&gt;&lt;string&gt;9.0.2&lt;/string&gt; ... &lt;dict&gt; &lt;key&gt;2471&lt;/key&gt; &lt;dict&gt; &lt;key&gt;Name&lt;/key&gt;&lt;string&gt;Check The Rhime&lt;/string&gt; &lt;key&gt;Artist&lt;/key&gt;&lt;string&gt;A Tribe Called Quest&lt;/string&gt; ... &lt;/dict&gt; &lt;key&gt;2473&lt;/key&gt; &lt;dict&gt; &lt;key&gt;Name&lt;/key&gt;&lt;string&gt;A Short History of Nearly Everyth ing (Unabridged), Part 1&lt;/string&gt; &lt;key&gt;Artist&lt;/key&gt;&lt;string&gt;Bill Bryson&lt;/string&gt; ... &lt;/dict&gt; </code></pre>
 

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