2 Replies Latest reply on Dec 6, 2011 4:21 AM by PeterWindle

    Setting the cursor insertion point

    PeterWindle

      Hey, FileMaker Pro has a function to obtain the current cursor position wihtin text in a field, but is there a way to set the cursor position ?? I want to go to a field and have the cursor default to a set position, but I can't seem to see any function to do so... am I missing something??

        • 1. Re: Setting the cursor insertion point
          RayCologon

          PeterWindle wrote:

          Hey, FileMaker Pro has a function to obtain the current cursor position wihtin text in a field, but is there a way to set the cursor position ?? I want to go to a field and have the cursor default to a set position, but I can't seem to see any function to do so... am I missing something??

           

          Hi Peter,

           

          Assuming you're using a script or button command to place focus on the field, you can specify the cursor position using the Set Selection[ ] command, which you'll find in the "editing" group of script steps:

           

          SetSelection.png

           

          This command allows you to specify the field to act upon (so you won't need to include a separate Go To Field [ ] command...).

           

          To have the Set Selection[ ] command simply insert the cursor (rather than select some of the field's content) you'll need to specify a selection end position that's one character less than the start position (because the start position specifies which character the selection or insertion point should precede, and the end position refers to which character the selection or insertion point should follow) - so, for example, to place the cursor immediately after the first character in a field, you would use:

           

          Set Selection [Data:YourTable::YourField; Start Position: 2; End Position: 1]

           

          Regards,

          Ray

          ------------------------------------------------

          R J Cologon, Ph.D.

          FileMaker Certified Developer

          Author, FileMaker Pro 10 Bible

          NightWing Enterprises, Melbourne, Australia

          http://www.nightwingenterprises.com

          ------------------------------------------------

          1 of 1 people found this helpful
          • 2. Re: Setting the cursor insertion point
            PeterWindle

            Sweet. There is far more to this solution than just this component, but this helps resolve most of it, thanks!