You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered some problems with parameterized attributes. (running MacOS 12, Monterey)
The Attribute enum for parameterized values are incorrect... they shouldn't end with Parameterized.
enumAttribute{case boundsForRangeParameterized ="AXBoundsForRangeParameterized"
// should be:
case boundsForRangeParameterized ="AXBoundsForRange"}
Personally, I would also like the parameterized attributes to be separated into another enum. I'm not sure why they're in the same enum in the first place... they're never interchangeable are they?
I realize it's probably for simplicity of functions like attributeIsSupported... but I'd still think it makes sense for them to be separated.
The other thing I found is that the parameterizedAttribute in UIElement doesn't work correctly.
I was trying to set AXBoundsForRange and passing in a CFRange, but it would throw an AXError.IllegalArgument error.
I figured out that it's because the param value does not use packAXValue, unlike setAttribute.
openfunc parameterizedAttribute<T, U>(_ attribute:String, param:U)throws->T?{...leterror=AXUIElementCopyParameterizedAttributeValue(
element, attribute asCFString, param asAnyObject,&value
)
// should be something like this:
leterror=AXUIElementCopyParameterizedAttributeValue(
element, attribute asCFString,packAXValue(param),&value
)...}
I can't easily test this fully, since I can't access packAXValue in an extension (because it's fileprivate), but doing manual conversion to an AXValue seems to fix it!
The text was updated successfully, but these errors were encountered:
I've encountered some problems with parameterized attributes. (running MacOS 12, Monterey)
The
Attribute
enum for parameterized values are incorrect... they shouldn't end withParameterized
.Personally, I would also like the parameterized attributes to be separated into another enum.
I'm not sure why they're in the same enum in the first place... they're never interchangeable are they?I realize it's probably for simplicity of functions like
attributeIsSupported
... but I'd still think it makes sense for them to be separated.The other thing I found is that the
parameterizedAttribute
inUIElement
doesn't work correctly.I was trying to set
AXBoundsForRange
and passing in aCFRange
, but it would throw anAXError.IllegalArgument
error.I figured out that it's because the
param
value does not usepackAXValue
, unlikesetAttribute
.I can't easily test this fully, since I can't access
packAXValue
in an extension (because it'sfileprivate
), but doing manual conversion to anAXValue
seems to fix it!The text was updated successfully, but these errors were encountered: