Problem changing text field via script

I’m sure I’m missing something very obvious, but I’m having a problem setting the .text property of a Text Field after a double click. I would like the current date / time to be entered into a Text field when the user double clicks in the field.

Here is my code which doesn’t work.
Under the MouseClicked event:

if event.clickCount == 2: today = timestamp=,event.source.Format) event.source.text = timestamp

the event.source.text will not update. I noticed if I hit the Enter key while I’m double clicking then the change is made. I guess I need to be able to programmatically send the enter key, but I’m haven’t figured out how to do that. Any help would be greatly appreciated.



in the text field property editor unclick “Reject Updates During Edit”
it should work fine.

Thanks! I knew it had to be something I was missing. :slight_smile:
Appreciate the quick reply!