Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.filemaker > #3220

Re: Scripting: Putting the Cursor into a Specific Field

From Helpful Harry <HelpfulHarry@BusyWorking.com>
Newsgroups comp.databases.filemaker
Subject Re: Scripting: Putting the Cursor into a Specific Field
Date 2018-10-22 13:39 +1300
Organization Aioe.org NNTP Server
Message-ID <pqj67c$1bf2$1@gioia.aioe.org> (permalink)
References <1nx0y5j.3xtd161uvtfy1N%csampson@inetworld.net>

Show all headers | View raw


On 2018-10-21 21:20:36 +0000, Charles H. Sampson said:

> In a script, how do I remember a field and later put the cursor into
> that field and make it the active field? I've experimented with Go To
> Object and Set Field by Name (in this case setting it to its saved
> initial contents). In spite of what the online documentation seems to
> say, neither of these leaves the cursor in the field/object, instead
> putting it into the next field in tab order.
> 
> Am I misreading? Am I doing something else wrong?
> 
> FMP 16.

Each new re-worked version of FileMaker Pro just gets messier and 
messier. Even the Script "Workspace" (the stupid name for the Script 
Editor) is unnecessarily over-complicated.   :o(

This function used to be very easy, but now it seems to be somewhat 
more complicated. I managed to get it to work using this technique ...

1.  In Layout Mode, click in each Field on the Layout one at a time
    and give each a unique Object Name in the silly Inspector palette
    (for the sake of ease of use and understanding, it's probably best
    to simply use an Object Name which is the as the Field's name in
    the Define Fields window).

2.  Create a new Global Text Field called g_ActiveField which the Scripts
    can use to store the currently active Field's Object Name (you can
    probably use a Variable if you prefer).

3.  Now you can use two commands in your Scripts:
      - to store the Object Name of the currently active field use
            Set Field [g_ActiveField; Get(ActiveLayoutObjectName)]

      - to go to the Field stored in g_ActiveField
            Go To Object [Object Name: g_ActiveField]

I tried using Get(ActiveFieldName) and Go To Field, but they didn't 
seem to want to work in my quick tests.

If you want to set position the cursor within a Field's data (by 
default it appears on the end of any existing data), you might be able 
use the Set Selection command, but that may suffer the same possible 
problems as Go To Field when not hard-coding which Specific Field you 
want to be in.


Helpful Harry  :o)

Back to comp.databases.filemaker | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Scripting: Putting the Cursor into a Specific Field csampson@inetworld.net (Charles H. Sampson) - 2018-10-21 14:20 -0700
  Re: Scripting: Putting the Cursor into a Specific Field Helpful Harry <HelpfulHarry@BusyWorking.com> - 2018-10-22 13:39 +1300
    Re: Scripting: Putting the Cursor into a Specific Field csampson@inetworld.net (Charles H. Sampson) - 2018-10-22 17:23 -0700
      Re: Scripting: Putting the Cursor into a Specific Field Helpful Harry <HelpfulHarry@BusyWorking.com> - 2018-10-23 19:17 +1300
        Re: Scripting: Putting the Cursor into a Specific Field csampson@inetworld.net (Charles H. Sampson) - 2018-10-26 19:02 -0700
          Re: Scripting: Putting the Cursor into a Specific Field none@gmail.com - 2018-10-27 16:38 +0200
            Re: Scripting: Putting the Cursor into a Specific Field Helpful Harry <HelpfulHarry@BusyWorking.com> - 2018-10-28 18:13 +1300
              Re: Scripting: Putting the Cursor into a Specific Field csampson@inetworld.net (Charles H. Sampson) - 2018-11-07 20:09 -0800
            Re: Scripting: Putting the Cursor into a Specific Field csampson@inetworld.net (Charles H. Sampson) - 2018-11-07 19:32 -0800
          Re: Scripting: Putting the Cursor into a Specific Field Helpful Harry <HelpfulHarry@BusyWorking.com> - 2018-10-28 18:15 +1300
            Re: Scripting: Putting the Cursor into a Specific Field csampson@inetworld.net (Charles H. Sampson) - 2018-11-07 20:09 -0800
  Re: Scripting: Putting the Cursor into a Specific Field Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2018-10-21 18:15 -0700
    Re: Scripting: Putting the Cursor into a Specific Field csampson@inetworld.net (Charles H. Sampson) - 2018-10-22 17:23 -0700

csiph-web