DataLoad命令集
Sending Keystrokes
By default, DataLoad Macros use copy and paste to enter data into the target application, and on most occasions this is the best approach. Occasionally, however, it is desirable to be able to send keystrokes to the application. DataLoad allows you to send the entire keyboard's printing and most non-printing (E.g. the function keys) characters to the active window as if they were typed at the keyboard. To specify that a cell should result in key presses the text should be preceded with a backslash. For example, the following would result in each of the specified keys, except for '\', to be sent as simulated key presses.
\Send this as keystrokes
To send a cell which must start with a backslash using copy and paste, precede the cell text with a second backslash. For example, the following will cause "\Send this as keystrokes" to be pasted into the target application:
\\Send this as keystrokes
One or more characters represent each key. To specify a single keyboard character, use the character itself. For example, to send the letter A, use \A. To send multiple characters, append each additional character to the one preceding it. To send the letters A, B, and C, use \ABC. When DataLoad presses a specified key it automatically takes account of any other key which may need to be pressed to send the exact character which was specified. For instance, if a form. field is populated by using the command \A an 'A' will appear in the field, that is the character's case is preserved. In the example of uppercase characters the shift key is automatically depressed with the character key to send an uppercase letter.
To use any combination of the Shift, Control, Alt and right Alt keys one of the following codes should be used:
Key Code
SHIFT +
CTRL
^
ALT %
Right Alt &
Each of these codes toggles the key in question. Each of these keys is initially in the "up" position and when one of those codes are used the desired key is depressed. When the code is used again the key is lifted, and so on. If any keys are left depressed when the DataLoad cell has been processed the key is lifted. The following are examples:
Cell Contents Effect in Active Window
\%F% Alt-F
\%F Same as above
If you want to send the +, ^, % or & keys these characters must be enclosed in braces {}. For example, to send '2 +2=4' the following should be entered in the DataLoad cell:
\{2+2=4}
To send a key or a number of keys multiple times, use the following syntax:
\{key(s) number}
You must put a space between the key(s) and number. For example, {d 10} means press d 10 times, while {Data 5} sends the keys 'Data' 5 times. The non-printing characters described below can also be sent multiple times in this way.
To specify characters that aren't displayed when you press a key, such as ENTER or TAB, and keys that represent actions rather than characters, use the codes shown below. Note that these codes are also enclosed in braces.
Key Code
BACKSPACE {BACKSPACE}
DELETE {DELETE}
UP ARROW {UP}
DOWN ARROW {DOWN}
LEFT ARROW {LEFT}
RIGHT ARROW {RIGHT}
END {END}
ENTER {ENTER}
TAB {TAB}
ESC {ESC}
HOME {HOME}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
INSERT {INSERT}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}
DATALOAD的基本操作命令:
TAB:按键盘上tab键一下;
\{TAB 2}:按tab键 两下,如此类推;
*DN:按向下箭头;
ENT:按ENTER键一下;
\^:代表CTRL键,如要按组合键如CTRL+S:\^S,CTRL+F4:\^{F4}(其他如此类推);
\%:代表ALT键,如要;按组合键如ALT+F:\%F(其他如此类推);
\{}:代表按下键盘上功能键,要什么功能键就在{}中写,如要按F1键:\{F1},向下的箭头键:\{DOWN}(其他如此类推);
*ML(684,120):代表按下鼠标左键,括号中的数字代表鼠标在屏幕上的坐标;
TAB:按键盘上tab键一下;
\{TAB 2}:按tab键 两下,如此类推;
*DN:按向下箭头;
ENT:按ENTER键一下;
\^:代表CTRL键,如要按组合键如CTRL+S:\^S,CTRL+F4:\^{F4}(其他如此类推);
\%:代表ALT键,如要;按组合键如ALT+F:\%F(其他如此类推);
\{}:代表按下键盘上功能键,要什么功能键就在{}中写,如要按F1键:\{F1},向下的箭头键:\{DOWN}(其他如此类推);
*ML(684,120):代表按下鼠标左键,括号中的数字代表鼠标在屏幕上的坐标;
(如:在ERP窗口把鼠标定位在需要点的位置,然后通过键盘上ALT+TAB键切换到DATALOAD的窗口输入“*ML”就会自动带出当前鼠标坐标。)
定位光标位置:
在DATALOAD程序的DATA位置,在Mainload单元格中输入:*ml(
*SL2:代表停留,后面的数字是停下的秒数;(在适当的位置停下一定的时间,可以使DATALOAD更加流畅,而且不容易出错。)
*SB:代表按下 空格键;
这里只是将比较常用的命令列出来,大家可以举一反三,并在使用中不断熟悉。
在写DATALOAD的过程中,要注意根据窗口切换时的时间,插入一些时间的停留命令,使其有适当的停顿将会避免出错。
对于以下的设置,对时间的控制也是非常重要的: