-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyObject.swift
More file actions
34 lines (25 loc) · 751 Bytes
/
Copy pathMyObject.swift
File metadata and controls
34 lines (25 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// MyObject.swift
// AppleScriptObjectList
//
// Created by Dov Frankel on 1/29/15.
// Copyright (c) 2015 Abbey Code. All rights reserved.
//
import Cocoa
var nextUniqueID = 0
class MyObject: NSObject {
let permanentID = ++nextUniqueID
func displayName() -> String {
return "Name \(permanentID)"
}
func objectSpecifier() -> NSScriptObjectSpecifier {
let appDesc = CustomApplication.classDescription() as NSScriptClassDescription
return NSUniqueIDSpecifier(containerClassDescription: appDesc,
containerSpecifier: nil,
key: "myobject",
uniqueID: permanentID)
}
func isSelected() -> Bool {
return permanentID % 2 == 0
}
}