Link to home
Start Free TrialLog in
Avatar of Steve_Brady
Steve_BradyFlag for United States of America

asked on

What is this code and how can I insert a pause or sleep command?

Hello,

Can someone tell me if they recognize this code?*
Sub Main
	SendKeys "v"
	SendSystemKeys "{Ctrl+l}"
	SendKeys "0"
	SendSystemKeys "{Right}"
End Sub

Open in new window

Is it Visual Basic?
If not, can you tell me what it is called?
Also, can you tell me how to insert a pause or sleep?

I am familiar with a scripting language called AutoHotkey (AHK). When creating a script in AHK, I can insert a pause by entering the word "Sleep" followed by some number of milliseconds. So for example, with the following script:
F1::
    MouseMove, 400, 600
    Click
Return

Open in new window

, when the F1 key is pressed, the mouse cursor is immediately moved to x = 400, y = 600 and this is immediately followed by a mouseclick.


However, if the same script is modified by inserting a "Sleep" command:
F1::
    MouseMove, 400, 600
    Sleep, 2300
    Click
Return

Open in new window

then the resulting action (when the F1 key is pressed) is identical to above but with a 2.3 second pause between the mouse movement and the click.

So what I'm trying to figure out is how to insert a similar pause or sleep in the code shown at the beginning of this question.

Thanks

* The code is from the Command Browser in Dragon NaturallySpeaking voice recognition software. The Command Browser enables the user to create verbal commands which the software then converts to some entry on the screen as determined by the scripting code.

In this specific example, the verbal command is phonetically defined as:

        "vee sub zero"

and the code is meant to enter the  letter "v" followed by a subscript zero and that is followed by a cursor move one space to the right.
ASKER CERTIFIED SOLUTION
Avatar of Randy Downs
Randy Downs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steve_Brady

ASKER

Thanks