Hi. I searched here on the focusing of the text fields but none of it seems to help me in this situation. Maybe there is something else that needs to happen before I try the focusing of the text field.
Anyway, I have a script I wrote in plain applescript that I’m trying to turn into an AS Studio project. It works well and pretty much as planned. However, I can’t seem to get the focusing thing working. The interface is pretty simple with 23 text fields to fill in and two buttons - one to start the actions needed and the other to quit. I have it set up so that tabbing from a text field will tab down the first column and then from the bottom of the first to the top of the second. A few of the text fields have default values in them so I don’t necessarily have to fill in every text field and some don’t need to be filled out at all. So, if I use the default values and then have the app do it’s thing, the focus remains where the last text field was edited. I’m trying to reset the focus through a handler I called “textCleaner”. Here’s that bit of code.
on textCleaner(w)
tell w
set contents of text field "jobNumber" to "S"
set contents of text field "description" to ""
set contents of text field "itemNumber" to ""
set contents of text field "fSlitW" to "0"
set contents of text field "fCenter" to "0"
set contents of text field "sCenter" to "0"
set contents of text field "rptLength" to "0"
set contents of text field "maxDecoW" to "0"
set contents of text field "maxDecoL" to "0"
set contents of text field "diameter" to "0"
set contents of text field "c1" to "Cyan (H)"
set contents of text field "c2" to "Magenta (H)"
set contents of text field "c3" to "Yellow (H)"
set contents of text field "c4" to "Black (H)"
set contents of text field "c5" to ""
set contents of text field "c6" to ""
set contents of text field "c7" to ""
set contents of text field "c8" to ""
set contents of text field "c9" to ""
set contents of text field "c10" to ""
set first responder to text field "jobNumber"
end tell
end textCleaner
The bulk of the script works with Illustrator CS. Ill CS is the front application when my app finishes. The window for my app stays open until I quit it. I don’t know if this has anything to do with the focusing problem or not. All the text fields are reset as I need, so I’m thinking this is not so, but . . . ?
Thank you.
PreTech
P.S. I forgot to mention that w in the code above is set to the window of theObject (theObject being one of the buttons).