Page 1 of 1

Using "Command + F" to call a function

Posted: Thu Mar 12, 2015 3:20 am
by JackBroughton
Hi all,

I created a search function that works now I want that function to be called if "Command + F" is pressed.

How do I do this?

Any help will be appreciated!

Jack

Re: Using "Command + F" to call a function

Posted: Thu Mar 12, 2015 3:47 am
by dunbarx
Jack

I normally would:

1- Make you jump through hoops.
2- Annoy half the helpers here.

The important thing is to know is that you want to invoke a function, but you need a message to do that. A message that is sent when you press the commandKey.

You might, knowing you need a message, and that the commandKey is involved, find "commandKeyDown" in the dictionary.

Try this:

Code: Select all

on commandKeyDown tKey
   if tKey = "F" then answer "It's an F!"
end commandKeyDown
So a little hoop. Where is the best place to put this handler?

Craig Newman