We help IT Professionals succeed at work.
Get Started

Assign the location for the clicks in an Autohotkey script when script starts

greggstar
greggstar asked
on
1,172 Views
Last Modified: 2013-11-10
Hi, I have an Autohotkey script I use to do several actions in BMC Remedy. Problem is that if someone else wants to use this script or I change the position of the Remedy window, the clicks won't be in the right position. Is there any way to create some GUI or something similar that when the script starts will ask you first to assign the position of all the clicks ? This is the code I have :
^!v:: 
MouseClick, left,  391,  383
Sleep, 100
WinWait, BMC Remedy User - [Incident (Modify)], 
IfWinNotActive, BMC Remedy User - [Incident (Modify)], , WinActivate, BMC Remedy User - [Incident (Modify)], 
WinWaitActive, BMC Remedy User - [Incident (Modify)], 
MouseClick, left,  371,  500
Sleep, 100
Send, {SHIFTDOWN}i{SHIFTUP}nstall
MouseClick, left,  437,  382
Sleep, 100
MouseClick, left,  257,  621
Sleep, 100
WinWait, Create Task (link.link.link.net), 
IfWinNotActive, Create Task (link.link.link.net), , WinActivate, Create Task (link.link.link.net), 
WinWaitActive, Create Task (link.link.link.net), 
Send, New license purchase request{TAB}Please buy new licence for application Application ID. After the purchase has been finished, please provide us with the Purchase order number and the License key.{SPACE}For detailed information please check related incident.{TAB}Requested{SPACE}application{SPACE}{SPACE}{SPACE}Application{SPACE}ID{SPACE}PC{SPACE}Netbios{SPACE}name{SPACE}{SPACE}{SPACE}Requestor{SPACE}name{SPACE}{SPACE}{SPACE}Requestor{SPACE}PRID{SPACE}{SPACE}Location{SPACE}{SPACE}{SPACE}Cost{SPACE}centre{SPACE}{ENTER}
MouseClick, left,  160,  218
Sleep, 100
MouseClick, left,  420,  276
Sleep, 100
MouseClick, left,  444,  230
Sleep, 100
MouseClick, left,  417,  303
Sleep, 100
MouseClick, left,  471,  237
Sleep, 100
MouseClick, left,  416,  334
Sleep, 100
MouseClick, left,  462,  311
Sleep, 100
MouseClick, left,  840,  269
Sleep, 100
WinWait, Field "Scheduled Start Date+", 
IfWinNotActive, Field "Scheduled Start Date+", , WinActivate, Field "Scheduled Start Date+", 
WinWaitActive, Field "Scheduled Start Date+", 
MouseClick, left,  154,  341
Sleep, 100
WinWait, Create Task (link.link.link.net), 
IfWinNotActive, Create Task (link.link.link.net), , WinActivate, Create Task (link.link.link.net), 
WinWaitActive, Create Task (link.link.link.net), 
MouseClick, left,  834,  298
Sleep, 100
WinWait, Field "Scheduled End Date+", 
IfWinNotActive, Field "Scheduled End Date+", , WinActivate, Field "Scheduled End Date+", 
WinWaitActive, Field "Scheduled End Date+", 
MouseClick, left,  223,  75
Sleep, 100
MouseClick, left,  153,  352
Sleep, 100

!^b::
MouseClick, left,  509,  385
Sleep, 100
WinWait, BMC Remedy User - [Incident (Modify)], 
IfWinNotActive, BMC Remedy User - [Incident (Modify)], , WinActivate, BMC Remedy User - [Incident (Modify)], 
WinWaitActive, BMC Remedy User - [Incident (Modify)], 
MouseClick, left,  559,  451
Sleep, 100
MouseClick, left,  622,  616
Sleep, 100
MouseClick, left,  558,  474
Sleep, 100
MouseClick, left,  708,  648
Sleep, 100

Open in new window

Comment
Watch Question
This problem has been solved!
Unlock 2 Answers and 12 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE