JXA-userland / JXA

JavaScript for Automation(JXA) packages for TypeScript/Node.js.
MIT License
417 stars 21 forks source link

$.NSWorkspace.sharedWorkspace.iconForFile() not work #44

Open caoyongfeng0214 opened 2 years ago

caoyongfeng0214 commented 2 years ago
    var appIcon = $.NSWorkspace.sharedWorkspace.iconForFile('/System/Applications/TextEdit.app');
    $.CFShow(appIcon);
    // OUTPUT:
    // <NSImage 0x7fdfea675180 Size={32, 32}
    // RepProvider=<NSImageISIconRepProvider:0x7fdfe66046a0
    //     icon:<ISBundleIcon: 0x7fdfea673bc0>
    //     Bundle URL: file:///System/Applications/TextEdit.app/
    //     type: (null)
    //     tag: (null)
    //     tag class: (null)
    //     reps:(faulting)>
    //>

Can't get the correct icon.