How to select all text (cmd+a)?
Posted: Sat Apr 11, 2015 11:58 am
I'm stuck with the following problem (LC 7.0.4 on Mac): I have several text fields on my card. I'd like to give the users the possibility to mark all content of a text field as selected by pressing cmd+a on the keyboard, if the cursor is within the text field. I added a menu option "mark all" in MenuBuilder and assigned it the shortcut "cmd+a". I entered the following code in MenuBuilder:
This code has a behaviour I don't understand: If I have preselected some text in a text field, this selection gets cut after entering cmd+a (and is copied to the clipboard). If I just click into a text field and then enter cmd+a, nothing happens. How can I mark all of the text as selected in a focused text field?
Code: Select all
on menuPick pWhich
switch pWhich
[...deleted...]
case "mark all"
select the text of the target
break
end switch
end menuPick