Add AppleScript selected feeds property. Fixes #5293.

This commit is contained in:
Brent Simmons committed 2026-05-23 19:36:52 -07:00
1 parent e1111168f0
commit 12d86a697e
6 files changed
+45 -3

No files matched your search

@@ -70,6 +70,29 @@ extension NSApplication: @preconcurrency ScriptingObjectContainer {
}
}
@objc(selectedFeeds)
func selectedFeeds() -> NSArray {
let feeds = appDelegate.scriptingSelectedFeeds
let scriptableFeeds: [ScriptableFeed] = feeds.compactMap { feed in
return ScriptableFeed.scriptableFeed(for: feed)
}
return scriptableFeeds as NSArray
}
@objc(countOfSelectedFeeds)
func countOfSelectedFeeds() -> Int {
appDelegate.scriptingSelectedFeeds.count
}
@objc(objectInSelectedFeedsAtIndex:)
func objectInSelectedFeedsAtIndex(_ index: Int) -> ScriptableFeed? {
let feeds = appDelegate.scriptingSelectedFeeds
guard index >= 0 && index < feeds.count else {
return nil
}
return ScriptableFeed.scriptableFeed(for: feeds[index])
}
// MARK: --- scriptable elements ---
@objc(accounts)