Ranchero-Software / NetNewsWire

RSS reader for macOS and iOS.
https://netnewswire.com/
MIT License
8.43k stars 535 forks source link

Can't access AppleScript properties of `selected articles` #4218

Closed michaeljtsai closed 4 days ago

michaeljtsai commented 9 months ago

If I select a few articles and run this script with NetNewsWire 6.1.1 (macOS 14.2.1):

tell application "NetNewsWire"
    set _articles to selected articles
    repeat with _article in _articles
        get url of _article -- NetNewsWire got an error: Can’t get webFeed id "10947".
    end repeat
end tell

it fails. Similarly, the properties don’t show up in the Script Debugger explorer:

Script Debugger

This may also be related to issue #2332.

I think the problem may be that the webFeeds element only includes top-level feeds, but the articles I selected were from a feed that’s in a folder. It seems like here:

https://github.com/Ranchero-Software/NetNewsWire/blob/41ce3483833587ca92f1ff292c0c88590ab8e622/Mac/Scriptability/NSApplication%2BScriptability.swift#L80

we may want flattenedWebFeeds() instead of topLevelFeeds. Or, alternatively, the feed’s object specifier should include the full containment hierarchy.

brentsimmons commented 4 days ago

Fix in current main.