Accessibility API: set value of text field.
Accessibility API: set value of text field.
- Subject: Accessibility API: set value of text field.
- From: Steven Hamblin <email@hidden>
- Date: Tue, 9 Jun 2009 03:07:34 -0400
I'm using the Accessibility API to try and modify the value of a text
field (AXTextField) in another application, but I've run into a
problem: my code correctly identifies and modifies the contents of
the text field in question, and the text of the field visibly changes,
but the changes aren't registered by the program I'm trying to
control. Is there a way to do this in with the API without having to
generate keyboard events?
Sample code:
AXUIElementCopyElementAtPosition(appRef,
clickPoint.x,
clickPoint.y,
&betBoxRef);
NSString *valueToSet = [NSString stringWithFormat:@"%.2f",amount];
AXUIElementSetAttributeValue(betBoxRef,kAXValueAttribute,valueToSet);
And the text field changes to the value specified in "amount" but the
other program doesn't recognize the change - I have to go type the
number in myself to get it to pick up the change. Can anyone point me
in the right direction?
Cheers,
Steven.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden