JXA-userland / JXA

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

fix(types): fix Finder item url definition #29

Closed Arinono closed 3 years ago

Arinono commented 3 years ago

I wanted to use the type Finder.Item in my mapping, but the type defines a URL whereas the actual syntax is lowercase.

    const files = Application<Finder>('Finder').selection()

    return files.map((f: {kind: () => string; url: () => string}) => ({ kind: f.kind(), path: f.url() }))

Screenshot 2020-10-07 at 10 53 21


EDIT: Just so you know, I changed the Finder.sdef manually. The real one has the key URL, but it doesn't work this way: Screenshot 2020-10-07 at 11 45 17

azu commented 3 years ago

Thanks!

azu commented 3 years ago

v1.3.4 includes this fix.