Typinator is in fact another software.
Is there a way to do it in Filemaker?
I was thinking of using some sql calculation to extrapolate the required info.
But the problem is in triggering the script
I was thinking using controller keys for triggering (like Ctrl)
Is there a better way?
And can you suggest an sql calculation (because I am new to sql)
I think the sql part is not the most difficult part.
For this I'd devise some sort of in memory cache like a global variable for the values to gain speed.
Getting the start and end position of the abbreviation in the text is the challenge.
Unless you're willing to process the whole text looking for occurances of all possible abbreviations...
You need to extract the word from the text to perform a comparison with your table.
Also you will need to know the start and end position of that word.
I haven't figured this one yet.
Then you can perform
Set Selection(start ; end) and clear that text,
Insert Calculated Result () pastes the retrieved description at the cursor in place.
Triggering with OnObjectModify:
Get ( TriggerModifierKeys ) will allow you to look for the extra key. Possibly that combination would be ALT + SPACE.
CTRL + SPACE does not advance the cursor hence no modification, no trigger.
Just thinking out loud about how I would approach this.
If everything goes well, then performance testing will show if it's not a hinderance.
Finally I managed to do my first sql script
This is thanks to the SqlExplorer file
This was the difficult part for me.
It is not as difficult as I thought after all.
Still the part of triggering part which for sure must be with OnObjectModify.
And the easy part of it would be that the last word being typed (not the last word in the text) must only be evaluated.
So this must not be a problem with the cursor position.
Still I must think about the best trigger to use.
Possibly storing / appending each character as you type to a global variable and resetting it if the key combination is not triggered might work.
Perhaps triggering off of OnObjectKeystroke. Get Trigger Keystroke and Get Trigger Modifier Keys should help with that.
Sent from my iPhone
I used the sql to take the correct value from the abbreviation list
No global variables needed
I used the trigger ( OnObjectKeyStroke ) , with the script step: Code ( Get ( TriggerKeystroke ) )
This can detect any key on the keyboard depending on the code
And this can initiate my script to replace the Abbreviation in my text with the Details