-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathAXUIElement+Xcode.swift
More file actions
43 lines (33 loc) · 1.05 KB
/
AXUIElement+Xcode.swift
File metadata and controls
43 lines (33 loc) · 1.05 KB
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
35
36
37
38
39
40
41
42
43
import AppKit
import Foundation
// Extension for xcode specifically
public extension AXUIElement {
private static let XcodeWorkspaceWindowIdentifier = "Xcode.WorkspaceWindow"
var isSourceEditor: Bool {
description == "Source Editor"
}
var isEditorArea: Bool {
description == "editor area"
}
var isXcodeWorkspaceWindow: Bool {
self.description == Self.XcodeWorkspaceWindowIdentifier || self.identifier == Self.XcodeWorkspaceWindowIdentifier
}
var isXcodeOpenQuickly: Bool {
["open_quickly"].contains(self.identifier)
}
var isXcodeAlert: Bool {
["alert"].contains(self.label)
}
var isXcodeMenuBar: Bool {
["menu bar", "menu bar item"].contains(self.description)
}
var isNavigator: Bool {
description == "navigator"
}
var isDescendantOfNavigator: Bool {
self.firstParent(where: \.isNavigator) != nil
}
var isNonNavigatorSourceEditor: Bool {
isSourceEditor && !isDescendantOfNavigator
}
}