You cannot use F11 to trip the OnLayoutKeystroke script trigger. This option is specified in Layout Setup... BTW. And without a script trigger, Get ( TriggerKeystroke ) has nothing to "get".
You'll have to use a different method to enter find mode.
Thanks for the info. So the gist is I can't use F11 to enter Find Mode. Can I use any other function key? What I'm looking for is a single key to trigger find mode rather than ctrl + f.
My tests show that F2 is the only F key that will trip the script trigger.
The script shown enters find mode when F2 is pressed while ignoring all other keystrokes so that they can be used normally.
Thanks, Phil. Your knowledge is amazing. I had the script, but I couldn't get the key code right. Curious that only F2 works since it actually has a function, namely to pop up the layout list. Thanks again.
I agree that it's curious. There are so many different key combinations that cannot trip either of the keystroke triggers that I routinely use:
Show Custom Dialog [ "Key: " & Code ( Get ( TriggerKeystroke ) ) & " Modifiers: " & Get ( TriggerModifiers ) ]
as a quick way to test the key combination that I want to use with one of these triggers.