Re: AXUIElementCopyAttributeValue useage
Re: AXUIElementCopyAttributeValue useage
- Subject: Re: AXUIElementCopyAttributeValue useage
- From: Modesitt Software <email@hidden>
- Date: Wed, 7 Jan 2004 17:52:22 -0800
What about extracting a string? My code first does this:
CFTypeRef cfRef;
axErr = ::AXUIElementCopyAttributeValue( inElement, kAXTitleAttribute,
&cfRef );
Then I do this to get the title as a Pascal string:
CFStringRef theCFStr = ::CFCopyDescription(cfRef);
Str255 theStr;
bool value = ::CFStringGetPascalString( theCFStr, theStr, 256,
kCFStringEncodingMacRoman);
theStr now contains this:
"\p<CFString 0x6a9eb0 [0xa01900e0]>{contents = \"Re:
AXUIElementCopyAttributeValue useage\"}"
Is there a method to extract just the contents of CFStringRef? Right
now I parse it, looking for the quote characters, but it seems error
prone.
Thanks!
-Bill
On Jan 6, 2004, at 10:50 PM, John Louch wrote:
Check to see if cfRef is equal to kCFBooleanTrue or kCFBooleanFalse.
I.e.
if (cfRef == kCFBooleanTrue)
{
// its true
}
else // assuming cfRef != nil
{
// its false
}
In my code I use AXUIElementCopyAttributeValue on a window in this
manner:
CFTypeRef cfRef;
axErr = ::AXUIElementCopyAttributeValue( inElement, kAXModalAttribute,
&cfRef );
Then I get the pascal string from cfRef, and it looks like this:
"<CFBoolean 0xa0190b98 [0xa01900e0]>{value = false}"
It has the information I want, but how do I extract it? Do I have to
search the string for the sub-string "value=false" or "value=true" to
determine the value?
Or is there some function that tells me it's a Boolean value, and the
value is true (or false)?
thanks!
Bill
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.
--------------------------------------------------
John Louch Internet #: email@hidden
(805) 546 0216
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.