mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 08:17:16 +00:00
Add AppleScript selected feeds property. Fixes #5293.
This commit is contained in:
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)
|
||||
|
||||
Reference in new issue
Block a user