The trick is that by the time you click in the new field you've lost focus in the old field.
I believe what you could do is place an OnObjectExit script trigger on your container field and run the AppleScript there to copy the selected text. Then, on the OnObjectEnter script trigger you would paste.
However, there are lots of potential pitfalls with this that you'll have to manage - such as intermediate actions that also copy something into the clipboard or someone clicking in the target field without having selected anything in the container field (it will paste whatever is in the clipboard).
It seems that the OnObjectExit fires when clicking out of the interactive container and into some other field - very good
So I think it could be done this way, and I am aware of the "elegancy" of this solution, but I could set and clear a Global variable to control most of the pitfalls (if not all).
Can someone help with this AppleScript ?
You can probably use this:
tell application "System Events"
keystroke "c" using command down
The Perform AppleScript script step is in the OnObjectExit script trigger for the container field? And you have highlighted text in the container field, then clicked away (to trigger the OnObjectExit script trigger), before attempting cmd-v?
Yes I hilite the text in the pdf - click into another field. Can see via script debugger, that the script runs.
But the clipboard stays the same as it was before.
... so the trick doesn't work
What version OS are you using?
Also what version of FileMaker are you using?
FileMaker Pro Advanced 15
Mac OS 10.11.6