Segfault when calling AXValueGetValue

Issue #260 new
Davee Nguyen created an issue

I am getting segfaults when using AXValueGetValue

The following code reproduces it.
I have Safari opened to get the pid and window.

>>> import AppKit
>>> from ApplicationServices import *
>>> safari_pid = AppKit.NSRunningApplication.runningApplicationsWithBundleIdentifier_('com.apple.Safari')[0].processIdentifier()
>>> safari = AXUIElementCreateApplication(safari_pid)
>>> safari
<AXUIElement Application 0x7fe247b41920> {pid=387}
>>> err, window = AXUIElementCopyAttributeValue(safari, "AXFocusedWindow", None)
>>> window
<AXUIElement 0x7fe243418960> {pid=387}
>>> err, size = AXUIElementCopyAttributeValue(window, "AXSize", None)
>>> size
<AXValue 0x7fe243650360> {value = w:1440.000000 h:804.000000 type = kAXValueCGSizeType}
>>> AXValueGetValue(size, kAXValueCGSizeType, None)
Segmentation fault: 11

Comments (2)

  1. Log in to comment