Thank you for your post, and I apologize for the late reply.
Could you provide the steps you are taking?
Get ( TriggerKeystroke ) is similar to Get ( ActiveFieldName ). That is, if you tab out of the field, it is no longer active and nothing is returned. It sounds like your script parameter is trying to take the old value.
In the case of the Data Viewer, once the Get (TriggerKeystroke) has completed there is no value. If you insert a Pause Script step following the Get (TriggerKeystroke), you will then see the value.
The script trigger is correct as the keystroke is captured with the trigger.
Posts this old no longer float back into Recent Issues when a response is posted and thus I almost missed this one.
I wanted the current keystroke not an older value.
The idea is that I have a table that is alpabetically sorted by name and I wanted to scroll the window to expose the first name starting with the letter the user presses from the keyboard. Since I was creating a binary search script that I wanted to be able to use in other cases besides input from a keystroke, I wanted the script to use Get ( ScriptParameter ) to extract the value used in the binary search. Thus, to use this script on the layout in question, I put:
Get ( TriggerKeystroke )
in the parameter box of the script trigger.
Testing reveals that this will return a null value instead of the character of the key that was pressed. If I then write this one line script:
Perform Script ["Binary search" ; parameter: get ( TriggerKeystroke) ]
and set the script trigger to perform it, it works.
Thanks for the additional information. I have sent everything to Development and Testing for further review. I will keep you posted.
Testing informed me this functionality is the way it is designed to run. The value cannot be passed as a parameter with OnObjectKeystroke or OnLayoutKeystroke. The script has to be triggered first, so the script being called by OnObjectKeystroke or OnLayoutKeystroke can then use Get (TriggerKeystroke).
I reviewed the Help section for clarification, and for Get (TriggerKeystroke) it says:
"Returns a value when running a script triggered by an OnObjectKeystroke or OnLayoutKeystroke script trigger or running a script called from the triggered script; otherwise returns an empty string."
Although it doesn't really clear up why it can't be passed as a parameter, it appears the OnObjectKeystroke and OnLayoutKeystroke takes precedence for the key being pressed before the keystroke can be evaluated.
"That's the way it's designed to run?" How odd. The trigger has to fire to perform the script, but the get function can't return a value until the script actually runs? Very counter-intuitive in my book....
From what I am not finding in Help, it would appear an upgrade to the documentation on script parameters and how what limitations exist on how they evaluate would be useful...