Found a script that uses Excel to move the mouse in VBScript. This is almost exactly what I am looking for for my project, however I need to alter a small bit to enable me to enter coordinates in the code for it to move the mouse specifically to those coordinates; the code currently uses the current mouse position and moves from that position - I need to be able to have the mouse move to an ABSOLUTE position, not a RELATIVE one.
Here's the VBS code:
Option Explicit
Dim Excel, GetMessagePos, x, y, Count, Position
Set Excel = WScript.CreateObject("Excel.Application")
GetMessagePos = Excel.ExecuteExcel4Macro( _
"CALL(""user32"",""GetMessagePos"",""J"")")
x = CLng("&H" & Right(Hex(GetMessagePos), 4))
y = CLng("&H" & Left(Hex(GetMessagePos), (Len(Hex(GetMessagePos)) - 4)))
Position = "+ 180"
Position = "- 180"
Excel.ExecuteExcel4Macro ( _
"CALL(""user32"",""SetCursorPos"",""JJJ""," & x & " " & Position & "," & y & " " & Position & ")")
WScript.Sleep (100)
WScript.Echo "Program Ended"
According to the code, the position of the mouse is moved from it's CURRENT POSITION +180 then -180. I need this code altered so I can put both the positions (in variable names X and Y) and use those to set the exact position of the mouse pointer.
I have messed around with the Excel.ExecuteExcel4Macro part and checked out the documentation for the function to no avail. Please can you help? Thanks :)
EDIT: I'm using VBScript because the system I am creating this on is VERY locked down. I have no way of using any other technologies bar this one, so help would be appreciated!