Select Textbox/Focus on Textbox after "Return" is pressed

Hi all!

I have been scrounging the forums here for a few weeks now while I work on a photo-sorting application. I have found a lot of good tips here, but I can’t seem to find anything on this. (Maybe I just don’t know my terms well enough.)

In my program two words are entered in via text boxes, one is a category (the folder that the photo will move to) and one is the photo name (the new name of the file that is being sorted). I have set up the interface so that hitting the Return Key is the same as clicking the button and it will automatically rename and move the file. Everything works smoothly.

What I would like to have happen though, is that after the return key is hit / the button is pressed down the first textbox is then highlighted. That is, you are taken back to the “first step” of the workflow.

Is this a clear question? and if so, is there a way to do this.

Thanks much!

if im understanding you right something like

on clicked theObject
tell window “main”
set first responder to text field “TEST”
end tell
end clickedILE"

Thank you much! That was exactly what I was looking for. The part I couldn’t figure out on my own was the “first responder” but it all makes sense now.