Using “whose” on arrays in Javascript for Automation

前端 未结 4 1119
攒了一身酷
攒了一身酷 2021-02-10 12:40

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         


        
4条回答
  •  隐瞒了意图╮
    2021-02-10 13:20

    This now works as theory would predict.

    (function () {
        'use strict';
    
        var iTunes = Application('iTunes'),
            filtered = iTunes.sources.whose({
                name: 'Library'
            });
    
        return filtered().length;
    
    })();
    

提交回复
热议问题