• 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
Re: Modifying table cell content via UI scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifying table cell content via UI scripting


  • Subject: Re: Modifying table cell content via UI scripting
  • From: Zack Jarrett <email@hidden>
  • Date: Wed, 10 Dec 2008 06:35:27 -0700

Perhaps you've solved this one already; I'm late at looking at this thread but am responding anyway.

UI scripting is fickle and requires extensive differentiation between applications. Some text boxes or input objects don't accept or reflect input the way you'd expect them to.

Try:
tell application "System Events"
	tell process "Hourglass"
		tell text field 1 of row 1 of table 1 of scroll area 3 ¬
			of splitter group 1 of window "Untitled"
				set value of attribute "AXFocused" to true
				set value of attribute "AXValue" to "string"
		end tell to "new string"
	end tell
end tell

Alternatively you could use the keystroke command in place of the 'set value of attribute "AXValue" to "string"'. It would look like:

tell text field 1 of row 1 of table 1 of scroll area 3 ¬
	of splitter group 1 of window "Untitled"
		set value of attribute "AXFocused" to true
		keystroke "string"
end tell to "new string"

After using either one of those you may have to confirm your change, like:

tell text field 1 of row 1 of table 1 of scroll area 3 ¬
	of splitter group 1 of window "Untitled"
	perform action "AXConfirm"
end tell to "new string"

If confirming with the action doesn't work you might have to do some kludgy tabbing out of the field or something to get your change to stick.

Another great app for GUI scripting is Apple's Accessibility Inspector. It's included in Developer Tools. Using it and prefab's UIBrowser the world of GUI scripting opens right up.

Good luck!

Zack

On Dec 2, 2008, at 12:55 AM, Sven A. Schmidt wrote:

I suggest going here:

http://www.prefab.com/uibrowser/

and downloading the trial version of UI Browser. Us that to precisely identify the field you want to modify.

Yes, that's how I came up with the "ui path" to the table cell :) Also, the fact that the script changes the value if I make the cell editable shows me that it's working. It is indeed the "set value" that's not changing the content.


Cheers,
Sven

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Modifying table cell content via UI scripting (From: "Sven A. Schmidt" <email@hidden>)
 >Re: Modifying table cell content via UI scripting (From: Ed Stockly <email@hidden>)
 >Re: Modifying table cell content via UI scripting (From: "Sven A. Schmidt" <email@hidden>)

  • Prev by Date: Re: How to add keywords to photos in iPhoto?
  • Next by Date: Re: Dock folder menus
  • Previous by thread: Re: Modifying table cell content via UI scripting
  • Next by thread: Re: Modifying table cell content via UI scripting
  • Index(es):
    • Date
    • Thread