What method can I use to select all the text in a text field when the text field is entered so user doesn’t have to swipe over all the text to select it manually - both tab or mouse clicked into.
I don’t know any way to do this without subclassing NSTextField. I think the code below will do what you want. You need to add a new file and paste this code into it, and in IB change the class of your text field to your new class.
script TF
property parent : class "NSTextField"
on becomeFirstResponder()
performSelector_withObject_afterDelay_("selectText:", me, 0)
return 1
end becomeFirstResponder
end script
Ric
It should work that way with a tab already. Doing it with a click flies in the face of the interface guidelines – how does a user then modify the contents without retyping it all?