I'm trying to create a voice command in Nuance Dragon (Professional Individual version) to switch my language input to Korean. I want it to press the associated hot keys, click the button to toggle to Hangul characters, and return the cursor to where it was when I started.
So basically:
- Get current position of mouse
- Press hot keys
- Click mouse at target location
- Set position of mouse to position in step one
I'm running into trouble with RememberPoint -- whenever I try to run the script, it gives me an error, telling me either that "Subs can't be used in expressions" (if put inside Sub Main) or that it expects a different command ("Expecting 'Declare|Delegate|Event|Function|Property|Sub|Const|Dim|Private|Public|Friend|Class|Enum|Module|Type' " if put outside Sub Main).
(NOTE: these are the two positions things I've tried, but I didn't do both of them at once, as below)
Dim originalPoint
originalPoint = RememberPoint
Sub Main
originalPoint = RememberPoint
End Sub
There is pretty much no documentation on RememberPoint*. I've looked through Dragon's samples , I've declare the variable as a String and Integer, and I've tried other declarations listed above. I expected RememberPoint to return a value in mouse coordinates but this seems wrong. Perhaps it should be something like a Sub or Event, but I've had no luck there.
Thanks!
Simon
*https://www.nuance.com/products/help/dragon/dragon-for-pc/scriptref/Content/scrptref/rememberpoint.htm, https://www.nuance.com/products/help/dragon/dragon-for-pc/scriptref/Content/scrptref/dragtopoint.htm
It seems you have difficulty getting and storing the current mouse position? Note, mouse positions are stored as two long numbers, one for each dimension.
Can you tell me if this helps get you where you want as it should demonstrate how to capture and use a mouse coordinate:
Of course, between getting and setting mouse positions, be also aware of your basic mouse coordination frameworks (as in Desktop, Window, etc.) which tell you which point to call
0,0and measure the offset from.