Questions tagged [axuielement]

7 questions
3
votes
1 answer

Swift - Get file path of currently opened document in another application

I am attempting to get the file path of an open document from another application using swift code. I know how to do it in AppleScript, which is like this: tell application "System Events" if exists (process "Pro Tools") then tell process "Pro…
kernelpanic
  • 530
  • 2
  • 8
  • 26
3
votes
1 answer

I am not able to get the range of selected text in TextEdit application from my background application

My application is agent type (running in background) and I have a button in window. when user select some text in TextEdit and trigger an action from my application I need to get the range of selection text. I am using below code but I am getting …
kulss
  • 2,057
  • 1
  • 14
  • 16
0
votes
1 answer

Is it possible to send a Selector to the frontmost application's first responder (i.e. the focused element) with permission?

Update Not sure the accessibility framework is the way to go here. Seems it only lets you interact with other apps, but not do things like programmatically send selectors to them. For more context, macOS has user-defined key-bindings…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
0
votes
0 answers

macOS Accessibility: Wrong Position of SharedTextUIElements

When requesting the related SharedTextUIElements of a AXUIElement using: var sharedTextElements: AnyObject? guard AXUIElementCopyAttributeValue(element, kAXSharedTextUIElementsAttribute as CFString, &sharedTextElements) The shared elements always…
Schurigeln
  • 189
  • 1
  • 7
0
votes
1 answer

Can the functions in AXUIElement.h be safely called from threads other than the main thread?

Are the macOS accessibility functions thread-safe, or safe to be called in threads other than the application's main thread? (i.e. the functions defined in AXUIElement.h) I've been working with them for years, and I still haven't been able to figure…
Bri Bri
  • 2,169
  • 3
  • 19
  • 44
0
votes
1 answer

Get application names running in Mac OS using AXUIElement in cocoa app

I am using AXUIElement to find out all running application in Mac OS. Using it, when I move mouse I get all application names when mouse over any application. But I want to filter out the applications which user has selected and have done any…
Krishna Maru
  • 164
  • 13
0
votes
0 answers

Window list from AXUIElementRef always null on High Sierra

After "upgrading" to macOS High Sierra it seems that some code that used to work does no longer. My goal here is just to list out the windows owned by an application. Here is an example: #import #import…
Jlegend
  • 531
  • 1
  • 6
  • 19