Using XCode 3.2.1 on Snow Leopard and creating an Applescript ObjectiveC project.
I an trying to figure out how to do two things:
Call an event upon each keypress in a text field.
Use Case: As user enters text, upon each keystroke, gather the text in the active text field, process it, concatenate the string with another stored string, and display it in a text View.
I know how to do everything except the dynamic part, (i.e. upon each key stroke)
I need to limit the range of characters entered in a text Field while it is being entered.
Use Case: I only want to allow the characters quoted here “abcdefghijklmnop123456789ABCDEFGHIJKLMNOP_-()”
Perhaps show an icon, or other visual queue that the user is trying to enter an invalid key if they type an unacceptable character.
Then I want to combine the two operations above display the text as it is entered.
Of course you’ll want to consider a case in which someone hits the delete button, potentially reducing the number of characters in the field to less than 8, you might, then, want to change the color of the text back to its original color.
It’s better to bind the string value of the text field to a property in your code, but I can’t give you example code that uses binding, so I went the other route.
to limit the range of characters entered in a text Field while it is being entered: