Modifying table cell content via UI scripting
Modifying table cell content via UI scripting
- Subject: Modifying table cell content via UI scripting
- From: "Sven A. Schmidt" <email@hidden>
- Date: Mon, 1 Dec 2008 22:23:05 +0100
Hi,
I've been directed to this list from the pythonmac-sig list after it
turned out that my problem is purely AppleScript related. I'm hoping
someone over here can point out where I'm going wrong. I'm not very
fluent in AppleScript so it's probably something simple I'm missing.
What I'm trying to do is script a non-scriptable application I wrote
via UI scripting (the "Enable access for assistive devices" thing in
"Universal Access"). More precisely I'm trying to update a string
value in a table cell. The code that I was hoping to do this with is
the following:
tell application "System Events"
tell process "Hourglass"
set value of text field 1 of row 1 of table 1 of scroll area 3 ¬
of splitter group 1 of window "Untitled" to "new string"
end tell
end tell
What I'm expecting is the string in the cell to change to "new
string". What's happening is, well, nothing.
When I double click the cell prior to running the script, thus making
it editable, the string does in fact change. If I click outside the
field afterwards to drop focus, the text changes back to the previous
value, discarding the change.
Apparently the value is not "committed" after editing in this case.
The table view is a CoraData driven NSTableView if that's relevant.
I know I can send a "Return" keystroke to commit the change and in
fact my workaround consists of "typing" the whole thing via keystrokes
in pyappscript. However, I'm curious if there isn't a better way to do
it.
Is there?
Any help, tips, pointers greatly appreciated,
Sven
_______________________________________________
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