KnowBrainer VB II includes New Mouse which captures the X&Y coordinates of your cursor, creates a new KnowBrainer application specific command (this cannot be accomplished in Dragon), names and saves your command in about 2 seconds. This is a single step command, slightly faster than using multiple MouseGrid strings but probably considerably easier to remember. However, if you would prefer to keep this in Dragon you can accomplish the same task by adding a few more quick steps and... if you wish to automate the process in Dragon via KnowBrainer VB II check out New Dragon Mouse command. We designed these commands for situations when you simply have no other choice, like hotkeys. The following command was created by Larry Allen, Polar Engineering and Valerie Matthews. We only added the verbal confirmation because there is otherwise no way to tell it worked, until you paste it.
Option Explicit
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Type POINTAPI
x As Long
y As Long
End Type
' declare Win32 API functions
Declare Function GetCursorPos Lib "user32" _
Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Declare Function GetWindowRect Lib "user32" _
Alias "GetWindowRect" (ByVal hwnd As Long, _
lpRect As RECT) As Long
Declare Function GetForegroundWindow& Lib "user32" ()
Function GetWinCurPos(hwnd As Long) As POINTAPI
Dim pt As POINTAPI
Dim wRect As RECT
Dim result As POINTAPI
GetCursorPos pt
GetWindowRect hwnd, wRect
result.x = pt.x - wRect.Left
result.y = pt.y - wRect.Top
GetWinCurPos = result
End Function
Sub Main
Dim hwnd As Long
Dim result As POINTAPI
Dim clip As String
hwnd = GetForegroundWindow
result = GetWinCurPos(hwnd)
clip = "SetMousePosition 1," & result.x & _
"," & result.y
clip = clip & Chr(13) & Chr(10) & _
"Wait 0.5" & Chr(13) & Chr(10) & _
"ButtonClick 1,1" & Chr(13) & Chr(10) & _
"Wait 0.5" & Chr(13) & Chr(10)
'
Clipboard clip
'
TTSPlayString "ready"
End Sub
-------------------------
Change "No" to "Know" w/KnowBrainer 2022
Trial Downloads
Dragon/Sales@KnowBrainer.com
(615) 884-4558 ex 1