• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Accessibility API: set value of text field.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: [job] learning cocoa developing a project
  • Next by Date: Re: self Changes on Open Panel
  • Previous by thread: [job] learning cocoa developing a project
  • Next by thread: Crash during printing an offscreen image view
  • Index(es):
    • Date
    • Thread