Right now I have a script which will copy numbers and then paste them into the correct field in another window and does a few other things. Largely the script is dependent on different mouse click positions.
My question: Is there an alternative way of finding fields without using a mouse position? I need to use this on a few different computers and they are all set up a little bit different and positions are in different spots.
Every time i use the script on a different computer, the fields will be in a different place and the script will not work correctly.
Mouse Position Alternative?
Started by
brettahk
, Dec 28 2007 07:45 PM
13 replies to this topic
#1
-
Posted 28 December 2007 - 07:45 PM
it depends on your target program.
Web browsers -> javascript
skinned, Flash or Java programs -> hard
others -> ControlSend, ControlClick, Control, etc.
Web browsers -> javascript
skinned, Flash or Java programs -> hard
others -> ControlSend, ControlClick, Control, etc.
#2
-
Posted 28 December 2007 - 07:49 PM
Thanks for the help. I found out the ClassNN field is Edit1.
How do i tell the script to go to that location?
This would help me out sooo much, thanks for any help
How do i tell the script to go to that location?
This would help me out sooo much, thanks for any help
#3
-
Posted 28 December 2007 - 08:28 PM
move the mouse there or just put text there
ControlFocus and Control will help you there.
ControlFocus and Control will help you there.
#4
-
Posted 28 December 2007 - 08:40 PM
alright it works but there are multiple fields with that label.
I found out I could also have it search for text and if I click on the "Request #" Text it will go to the field that I want.
Therefore I need to find out how to click where the text Request # is.
Is this possible?
I found out I could also have it search for text and if I click on the "Request #" Text it will go to the field that I want.
Therefore I need to find out how to click where the text Request # is.
Is this possible?
#5
-
Posted 28 December 2007 - 08:55 PM
you could WinGet ControlList and then loop through the results, though the label and the edit field are different fields.
There should not be more than one Edit1
There should not be more than one Edit1
#6
-
Posted 28 December 2007 - 09:02 PM
well the problem is that the program has 4 windows on the main page. In each window are multiple fields of data and window spy is showing the same "Edit1" Label in each window. But I was thinking maybe i could tell the script to click in the correct window and then click in the Edit1 field. If I have problems I will let you know.
Thanks for all the quick help engunneer.
Thanks for all the quick help engunneer.
#7
-
Posted 28 December 2007 - 09:08 PM
alright well I was able to find out pretty quickly it did not work.
heres the code
Button10 is the window field and Edit1 is the field i want to insert numbers into.
heres the code
^1:: WinActivate, CMRS - All Service Requests IfWinActive, CMRS - All Service Requests ControlClick, Button10, CMRS - All Service Requests, Sleep, 100 ControlClick, Edit1, CMRS - All Service Requests, Return
Button10 is the window field and Edit1 is the field i want to insert numbers into.
#8
-
Posted 28 December 2007 - 09:10 PM
can you post a screenshot of the app? is it an MDI (Multiple document interface) or some funky tabbed program?
#9
-
Posted 28 December 2007 - 09:14 PM
Alright heres a screenshot.
As you can see there is actually 5 windows, and there are multiple Edit1 labels and then I thought I could get around it by telling it to first click the Request Information button and then the Edit1 label which is the Request # field.
Now that you can see the program all I want is to hit Ctrl+1 and then go to this program and click at the Request Number field. Using a mouse position works but only on my computer. I use several different computers and the time this would save would be immense as I also have scripts set up for other menu's.
Thanks for the help
As you can see there is actually 5 windows, and there are multiple Edit1 labels and then I thought I could get around it by telling it to first click the Request Information button and then the Edit1 label which is the Request # field.
Now that you can see the program all I want is to hit Ctrl+1 and then go to this program and click at the Request Number field. Using a mouse position works but only on my computer. I use several different computers and the time this would save would be immense as I also have scripts set up for other menu's.
Thanks for the help
#10
-
Posted 28 December 2007 - 09:20 PM
you'll have to host the picture somewhere other than your gmail. try autohotkey.net
#11
-
Posted 28 December 2007 - 09:29 PM
it's odd for each one to have an Edit1 with a layout like that. It hink you can do it, but it will relly just be a bunch of mucking about with commands taht start with Control.
does each sub window show up with a different wintitle in the window spy?
does each sub window show up with a different wintitle in the window spy?
#13
-
Posted 28 December 2007 - 09:48 PM
Ya if I click on Request Information window spy shows ClassNN as Button10 but if I click on Requestor Information then it shows up as Button 14. If I click on response information and hover over the button it shows up as button 26. So I have no clue what to do.
#14
-
Posted 28 December 2007 - 09:51 PM