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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to