focus on selected row (by scroll visible rows or focused or...)

Hi All,

I have an app I’m trying to control via UI Scripting.
The structure
outline 1 of scroll area 1 of group 1 of splitter group 2 of splitter group 1 of window “pallet.qlab : Marjorie’s List”

My script selects a random row (let’s say row 60).

Right now it selects it, but I would also like the app to “focus” on the row. Right now, if it’s below the scroll section it doesn’t auto-scroll down.

Here are some attributed I found in PreFab UI Browser
visible roles (attribute of outline)
focused (text field 1 of row 60)

First, I tried:
visible rows of outline 1 of …
(but that doesn’t compile… because I’m guessing visible is a reserved word, so it’s expecting something else)
The idea of this method was to count how many rows my scroll area shows at a time, then do the math to figure out how many page-downs I have to do.

Then I tried,
set focused of text field 1 of rtnRow to true
but that gave me this error:
System Events got an error: NSInternalScriptError

Any Ideas?

Hi,

GUI scripting is very dependent on the targeted application.
Maybe you can set the focus of a row with

set value of attribute "AXFocused" of text field 1 of rtnRow to true

but then the (read-only) property settable must be true, otherwise it doesn’t work

That worked perfectly, thanks!

I don’t know why I was having problems using “AXFocused” or “AXVisibleRows” before. It was simply returning:
attribute “AXFocused” of text field 1…

I was trying to get it to return true or false