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

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

Recommended Posts

Posted

Does anyone know a way for a script to set the cursor position within a field to a specific location? What I need to do is have a button that adds a note with attribution to the top of a notes field. So, if the field says "8/23/05 foo: this is weird", I need the script to add "8/23/05 bar: a new note" followed by a couple of line feeds.

It's easy to add the attribution and line feeds to the top of the field, but how do I then set the cursor to the end of the newly-in serted attribution so that someone can start typing there?

Thanks in advance.

Posted

A better idea is to use a global field for data entry, then set the non-modifiable notes field to

globalField & "¶¶" & notesField.

This way notesField cannot be modified accidentally.

Posted

Well, I started out doing something like that, but that approach introduces a level of indirection (having to enter data into a different field and/or layout than where it will be viewed), and I have found that users can find that counterintuitive and disorienting, or, at the least, an annoying extra step.

For that reason, I think doing it in the same field is the *better* solution, but if there's no way to set the cursor position (which I would have thought would be simple), then it's not going to be a *workable* one.

Posted

I agree with Queue (which BTW is generally the smart thing to do). Your objection is easily solved by designing the layout with a clearly marked "draft area" and a "Add to Notes" button.

That said, examine the Set Selection script step.

Posted

Sigh.

Well, I can't say I'm surprised; this is classic Filemaker. I've been working with the program long enough to know when to say "uncle" and do the workaround, so I'll just make the "Add Note" button bring up a layout with the global field and have a "Done" button that will update the Notes field.

By the way, I tried the Set Selection command, setting the start and end to be the same character right after the colon that designates the end of the "header." It didn't quite work, but I didn't fiddle with it, I just tried it once.

Thanks for your help, folks!

This topic is 7032 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.