February 15, 200620 yr I've got a comments text field in my database. I'd like to have a button which adds a user's name and the date to the top of the text field, and then positions the cursor beneath it so they can add text. The aim is that users can keep adding comments, with the newest always at the top and the facility to scroll down to see older comments. How can I pull this off? It occured to me that I can cut the entire contents of the field, insert the username and date, and then paste back the field contents. This would be fine, except that it requires the user to position the cursor before typing. I'd rather have the cursor automatically in the right place. I'm on MacOS, so could probably pull it off with an AppleScript, expect that I need this solution to work under Windows as well.
February 15, 200620 yr mga, This can be done pretty easily. Here is generally how it is done: Use the Set Field scrip step to make your big notes field equal to a couple of carriage returns & itself. Set Field [YourField; "¶¶" & YourField] (it may not be obvious but you can indeed set a field equal to itself) Then in the next step you can add: Set Selection [YourField; Start Position 1; End Position 1]
February 15, 200620 yr Author Thanks, that works. I used a solution similar to the first one, with these adaptations: Set Field [YourField; ¶ & ¶ & ¶ & YourField] Set Selection [YourField; Start Position 1; End Position 1] Insert Calculated Result [ ... & ¶] with a calculated result giving the string ">mm/dd/yy username". This adds in the information I want, and puts the cursor in the right position for user entry.
February 15, 200620 yr Cool. You could probably use Set Field instead of Insert Calculated Result but it sounds like it works for you.
Create an account or sign in to comment