AnsweredAssumed Answered

Return to "HOME" position in a field using scripts

Question asked by DaleRoark on Sep 1, 2011
Latest reply on Sep 2, 2011 by LaRetta_1


Return to "HOME" position in a field using scripts


I have a Comments field that has a time stamp in reverse order. The script is trigered by entry anywhere into the field. I would like to return to the end of the latest timestamp after restoring the previous comments. Here is what I have so far:

Set Variable [$Temp; Value;Companies::Comments]

          - This stores the current chain of comments in $Temp

Clear [Select; Companies::Comments]  

          - This clears the Comments field

InsertCurrentUserName []

InsertText[" - "

InsertCurrentDate []

InsertText[" - "]

InsertCalculatedResult [Companies::Comments; GetAsText ($Temp)]

         At this point I have something like:  'Smedley -  9/1/2011 - ' on the first line

         followed by several previous posts with their own name, date, and comment

         with the cursor at the bottom of all the comments

I want to position the cursor at the top of the field after the datestamp.  I can get there by 'ControlHome' followed by 'End" one the keyboard but I don't know how to imbed that in the script.

Thanks in advance for your comments,