mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
basic readonly scripting support for account, feed, folder
This commit is contained in:
30
Evergreen/Scriptability/NSApplication+Scriptability.swift
Normal file
30
Evergreen/Scriptability/NSApplication+Scriptability.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// NSApplication+Scriptability.swift
|
||||
// Evergreen
|
||||
//
|
||||
// Created by Olof Hellman on 1/8/18.
|
||||
// Copyright © 2018 Olof Hellman. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import Account
|
||||
|
||||
extension NSApplication : ScriptingObjectContainer {
|
||||
|
||||
var scriptingClassDescription: NSScriptClassDescription {
|
||||
return NSApplication.shared.classDescription as! NSScriptClassDescription
|
||||
}
|
||||
|
||||
var scriptingKey: String {
|
||||
return "application"
|
||||
}
|
||||
|
||||
@objc(accounts)
|
||||
func accounts() -> NSArray {
|
||||
let accounts = AccountManager.shared.accounts
|
||||
return accounts.map { ScriptableAccount($0) } as NSArray
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user