下面的脚本首先创建DeviceReplay对象,然后使用其SendString方法发送一段字符串,然后使用MouseMove方法移动鼠标,使用MouseClick方法单击鼠标:
Dim devicereplay
word = \"Hello World!\"
Set devicereplay = CreateObject(\"Mercury.DeviceReplay\")
devicereplay.SendString(word)
devicereplay.MouseMove 200,200
devicereplay.MouseClick 200,200,LEFT_MOUSE_BUTTON
而下面的脚本将按下“SHIFT”键:
Dim devicereplay
VK_SHIFT = 42
Set devicereplay = CreateObject(\"Mercury.DeviceReplay\")
devicereplay.KeyDown(VK_SHIFT)