If you use script trigger OnObjectExit of:
Go To Field [ field you specify ]
... it should work for you.
at first, «Exit Script» did nothing. But then the «False» did the trick. Ths is not documented.
It took me some time to figure it out: The stuff in brackets is the result that is returned to the parent script. When you return a boolean «False», the parent script halts; if you return nothing, the script continues.
What adds furthermore to the confusion, in the Specify Calculation window it is said that «Calculation result must be Text».
But anyway, no it works and thanks a lot for your help.
This is not documented.
Actually, it is though it could be spelled out more clearly. Quoting from FileMaker Help on "Setting up Script Triggers":
Some script triggers allow for the activating command or event to be canceled if the script executed by the script trigger returns a False value. When a command or event is canceled this way, the error code is set to 20. See Get(LastError) function for more information. If the script executed by the OnLastWindowClose script trigger returns a False value, then the file will not close.