I still don't understand how exiting with false quiets the dialog but it works! :)
If [code(Get(TriggerKeystroke)) = "27"]
Exit Script [Result: True]
Else If [is empty(Get(ActiveFieldname)) or PatternCount( FieldType ( Get(FileName) ; Get(ActiveFieldName) ); "Calc") > 0]
Exit Script [Result: False]
There are different types of script triggers. Some are pre event triggers and others post event triggers. A post event will fire the script after the event action. A pre event trigger fires the script before the event is processed. You can cancel that event by returning false / 0.
OnLayoutKeystroke is a pre event trigger that can be canceled.
I had a feeling you would like that one deltatango , after reading all the other posts about dialog messages etc.
This particular one has annoyed me forever ! well until FM10.
Tiny correction: " or PatternCount( FieldType ( Get(FileName) ; Get(ActiveFieldName) ); "Calc") > 0"
This prevents the dialog box when trying to type in a calc field, but is not required simply to dismis the dialog box I was posting about..
But still a cool addition... The less annoying dialog's the better I say.
Annoyance meter +++++++
Annoyance meter ++++++
Annoyance meter +++++
Annoyance meter ++++
Annoyance meter +++
Many thanks! That "return False" did the trick. I remember seeing a reference to this ("There are different types of script triggers. Some are pre event triggers and others post event triggers...") somewhere, but FM could perhaps raise its profile in the Help files (e.g., add it to the entry for onLayoutKeystroke).
Why do we even need this dialog? It's annoying and the workaround slows text input, I vote to remove it altogether.