Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6858 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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]

Posted

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.

Posted

Cool. You could probably use Set Field instead of Insert Calculated Result but it sounds like it works for you.

This topic is 6858 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.