2018-01-11 09:51:25 +01:00
|
|
|
//
|
|
|
|
// ScriptingObjectContainer.swift
|
|
|
|
// Account
|
|
|
|
//
|
|
|
|
// Created by Olof Hellman on 1/9/18.
|
|
|
|
// Copyright © 2018 Olof Hellman. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2018-02-03 07:51:32 +01:00
|
|
|
import AppKit
|
2018-03-05 03:43:29 +01:00
|
|
|
import Account
|
2018-01-11 09:51:25 +01:00
|
|
|
|
|
|
|
protocol ScriptingObjectContainer: ScriptingObject {
|
2024-04-17 05:53:33 +02:00
|
|
|
@MainActor var scriptingClassDescription:NSScriptClassDescription { get }
|
|
|
|
@MainActor func deleteElement(_ element:ScriptingObject)
|
2018-01-11 09:51:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
extension ScriptingObjectContainer {
|
2018-02-11 10:20:30 +01:00
|
|
|
|
2024-04-17 05:53:33 +02:00
|
|
|
@MainActor func makeFormNameScriptObjectSpecifier(forObject object:NamedScriptingObject) -> NSScriptObjectSpecifier? {
|
2018-01-11 09:51:25 +01:00
|
|
|
let containerClassDescription = self.scriptingClassDescription
|
|
|
|
let containerScriptObjectSpecifier = self.objectSpecifier
|
|
|
|
let scriptingKey = object.scriptingKey
|
|
|
|
let name = object.name
|
|
|
|
let specifier = NSNameSpecifier(containerClassDescription:containerClassDescription,
|
|
|
|
containerSpecifier:containerScriptObjectSpecifier, key:scriptingKey, name:name)
|
|
|
|
return specifier
|
|
|
|
}
|
|
|
|
|
2024-04-17 05:53:33 +02:00
|
|
|
@MainActor func makeFormUniqueIDScriptObjectSpecifier(forObject object:UniqueIDScriptingObject) -> NSScriptObjectSpecifier? {
|
2018-01-11 09:51:25 +01:00
|
|
|
let containerClassDescription = self.scriptingClassDescription
|
|
|
|
let containerScriptObjectSpecifier = self.objectSpecifier
|
|
|
|
let scriptingKey = object.scriptingKey
|
2024-04-17 04:37:53 +02:00
|
|
|
let uniqueID = object.scriptingUniqueID
|
2018-01-11 09:51:25 +01:00
|
|
|
let specifier = NSUniqueIDSpecifier(containerClassDescription:containerClassDescription,
|
2024-04-08 01:09:23 +02:00
|
|
|
containerSpecifier:containerScriptObjectSpecifier, key:scriptingKey, uniqueID: uniqueID)
|
2018-01-11 09:51:25 +01:00
|
|
|
return specifier
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|