-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Refactor #1
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2496820
Refactor
pmanot cf24ae9
make `Token` conform to Cancellable
pmanot 2b8aa01
refactor
pmanot 55ca837
expose accessibility window through `NSRunningApplication`
pmanot 1cdaeb2
fix access level
pmanot e6d053d
remove unnecessary `throws`
pmanot e387f95
cleanup
pmanot 58e4746
add CLI tool + cleanup
pmanot 1125e8c
update axdump
pmanot 20511b3
cleanup
pmanot e7bd7ab
cleanup
pmanot ca8781f
change minimum deployment version to 10.15
pmanot e8da38e
add utilities and helpers + refactor
pmanot d322e81
add ax constants generator + regenerate accessibility constants
pmanot 9b35615
change default runloop for observation back to `.current`
pmanot 776d2fb
refactor
pmanot 60ba843
refactor
pmanot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,5 @@ DerivedData/ | |
|
|
||
| # SwiftLint Remote Config Cache | ||
| .swiftlint/RemoteConfigCache | ||
| .claude | ||
| MEGAREADME.md | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Sources/AccessibilityControl/NSRunningApplication+Accessibility.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import AppKit | ||
| import WindowControl | ||
| import Cocoa | ||
|
|
||
| extension NSRunningApplication { | ||
| public var _accessibilityElement: Accessibility.Element { | ||
| .init(pid: self.processIdentifier) | ||
| } | ||
|
|
||
| public var _accessibilityWindow: WindowControl.Window? { | ||
| try? self._accessibilityElement.window() | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import Foundation | ||
| import ArgumentParser | ||
| import AccessibilityControl | ||
| import WindowControl | ||
| import AppKit | ||
| import CoreGraphics | ||
|
|
||
| // MARK: - Main Command | ||
|
|
||
| @main | ||
| struct AXDump: AsyncParsableCommand { | ||
| static var configuration = CommandConfiguration( | ||
| commandName: "axdump", | ||
| abstract: "Dump accessibility tree information for running applications", | ||
| discussion: """ | ||
| A command-line tool for exploring and debugging macOS accessibility trees. | ||
| Requires accessibility permissions (System Preferences > Security & Privacy > Privacy > Accessibility). | ||
|
|
||
| QUICK START: | ||
| axdump watch Live explore elements under cursor | ||
| axdump find 710 "Save" --click Find and click "Save" button | ||
| axdump find 710 --role TextField --type "hello" | ||
| axdump menu 710 "File > Save" -x Execute menu item | ||
|
|
||
| EXAMPLES: | ||
| axdump list List running applications with PIDs | ||
| axdump find 710 "OK" -c Find "OK" button and click it | ||
| axdump find 710 --role Button Find all buttons | ||
| axdump watch 710 --path Watch with element paths | ||
| axdump dump 710 -d 2 Dump tree (2 levels deep) | ||
| axdump menu 710 -m "Edit" -x Explore Edit menu | ||
| axdump key 710 "cmd+c" Send keyboard shortcut | ||
|
|
||
| WORKFLOW: | ||
| 1. Use 'watch' to explore UI and find elements interactively | ||
| 2. Use 'find' to locate and act on elements by text/role | ||
| 3. Use 'menu' to explore and execute menu items | ||
| 4. Use 'dump' for detailed tree exploration | ||
| 5. Use 'key' for keyboard shortcuts | ||
|
|
||
| REFERENCE: | ||
| axdump list --list-roles Show all known accessibility roles | ||
| axdump list --list-subroles Show all known subroles | ||
| axdump list --list-actions Show all known actions | ||
|
|
||
| For more help on a specific command: | ||
| axdump <command> --help | ||
| """, | ||
| subcommands: [ | ||
| List.self, | ||
| Find.self, | ||
| Watch.self, | ||
| Dump.self, | ||
| Query.self, | ||
| Inspect.self, | ||
| Observe.self, | ||
| Screenshot.self, | ||
| Action.self, | ||
| Set.self, | ||
| Key.self, | ||
| Menu.self, | ||
| Compare.self | ||
| ], | ||
| defaultSubcommand: List.self | ||
| ) | ||
| } | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.