Result Type: text
Definition: Get the symbolic name for a UI field from its index.
Allows you to get symbolic names of fields by iterating over the field numbers.
Example: To get a list of all of the symbolic field names in a window, activate the following script and then open the window of interest; then look in the log file (and deactivate the script).
on Before(w) Syslog(The window ID is " + GetWindowID(w)) foreach f in (1, GetFieldCount(w)) syslog(f + " " + GetFieldName(w, f)) endfor end
For the standard Transaction entry window, you'll get something like:
The window ID is F_TRANS 1 L_LINE 2 M_TABS 3 L_LIST 4 L_ENTRY 5 T_WOFFACCTDESC 6 T_PRODDESC 7 E_NAME 8 E_USERREF 9 E_DATE 10 M_PERIOD 11 M_BANK 12 E_ORDERNUM ....
Another way, assuming you are only interested in edit fields:
on EnterField(win, item) Navigator("", item) end
This will display a tooltip for every field in every window† as the field is activated.
†Note that the Script Editor window itself does not receive script events.
Availability: available within MWScript handlers.
GetFieldCount: Get the number of controls in a window (standard or custom)