Trouble with 'current field editor' and 'first responder'?

If I need to get the AppleScript name of the text field that is currently being edited, how do I do this?

If I ask for the ‘current field editor’ or ‘first responder’ of a window, the returned item has a ‘missing value’ for the ‘name’ (the name is definitely set in the NIB).

HOWEVER, the ‘super view’ of the ‘current field editor’ has a value similar to:

«class » id 9 of text field id 8 of view id 7 of tab view id 4 of window id 1 of application "Test App"

And if I manually type in this:

name of text field id 8 of view id 7 of tab view id 4 of window id 1 of application "Test App"

then the AppleScript name of the text field is returned, but now the problem is: how do I get everything but the first class of the ‘super view’? (I’ve tried “parent of” and “text field of”.)

Thanks,
Colin.

This will do it:

set current_focus to name of super view of super view of current field editor of window 1 as text

Yes, ‘super view’ must be specified twice.

-Colin.