Playing with the new JS for automation using Script Editor. I\'m getting an error on the final line of the following:
var iTunes = Application(\"iTunes\"); var s
This now works as theory would predict.
(function () { 'use strict'; var iTunes = Application('iTunes'), filtered = iTunes.sources.whose({ name: 'Library' }); return filtered().length; })();