Teckx Posted July 12, 2017 Share Posted July 12, 2017 I am using imagesearch and from where the mousemove goes to when it sees the image, I want it to move left on the screen a certain distance Link to comment Share on other sites More sharing options...
Teckx Posted July 12, 2017 Author Share Posted July 12, 2017 explanation of what im doing im grabbing a 'name' from a notepad going to IE and searching for it Imagesearch looks for the color blue of the highlighted search result there is a radio button to the left of that particular 'name' that I need to click there are 50+ of the identical radio buttons on the page so I cant search for that Link to comment Share on other sites More sharing options...
Teckx Posted July 12, 2017 Author Share Posted July 12, 2017 well anyways I noticed that when searching for the name having the mouse move to the variable coordinate it highlighted the button so I was able to now search for that highlighted button . awesome but for education purposes is there a way to change coordinates based on subtracting from the variable? TwistedXion 1 Link to comment Share on other sites More sharing options...
TwistedXion Posted July 13, 2017 Share Posted July 13, 2017 Hey, I just had to use this earlier today. Basically you want to use mousegetpos. Here is a link to forms where this was disused. Teckx 1 Link to comment Share on other sites More sharing options...
Teckx Posted July 25, 2017 Author Share Posted July 25, 2017 (edited) Please any help would be most appreciated!! I'm still having a little issue here. Here's my goal: 1) I want imagesearch to locate the word 'Notes' This word will move around every time I search for it so I cannot use static mouse coordinates for the next step. 2) After locating notes I want it to move the mouse right and highlight the text that's next to it (usually a few sentences) <-----This is the part I need help with Edited July 25, 2017 by Teckx Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 25, 2017 Share Posted July 25, 2017 @Teckx Your script seems very mechanic, and I don't like mechanic things ( at least, not scripts ). What you're trying to do is copy-paste a word that you search in a text file, go in IE, and click a (some) radio button(s) in a web-page... Is this your goal? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Teckx Posted July 25, 2017 Author Share Posted July 25, 2017 Just now, FrancescoDiMuro said: @Teckx Your script seems very mechanic, and I don't like mechanic things ( at least, not scripts ). What you're trying to do is copy-paste a word that you search in a text file, go in IE, and click a (some) radio button(s) in a web-page... Is this your goal? its part of a function I have going. The radio button is a differnt script I figured out- this one im referring to in this thread is the much more complicated one that will be an ongoing battle. This is the Else portion where it would copy notes from a completed ticket and then submit the notes to the customer saying their request (notes) was completed. I actually figured a way to just search for the Notes: (mousedown) then imagesearch for the end corner of the window (mouseup) copy paste and continue on So I guess this is now for education purposes if its even possible to subtract coordinates from a variable Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 25, 2017 Share Posted July 25, 2017 (edited) @Teckx 3 minutes ago, Teckx said: So I guess this is now for education purposes if its even possible to subtract coordinates from a variable You would like to substract coordinates ( of what? Mouse? Window? ) from a variable? If so, it should not be so difficult, but... Can you please explain step by step what your script should do? I'm asking this to you in order to help you as much as I can Edited July 25, 2017 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Teckx Posted July 25, 2017 Author Share Posted July 25, 2017 (edited) 4 minutes ago, FrancescoDiMuro said: @Teckx You would like to substract coordinates ( of what? Mouse? Window? ) from a variable? If so, it should not be so difficult, but... Can you please explain step by step what your script should do? I'm asking this to you in order to help you as much as I can I would like to subtract coordinates from the imagesearch MouseMove $x, $y coordinates say for example the Image im searching for (Notes) is always 5 inches away on the left from what I want to highlight and copy kind of confusing . look at my post/replies for example. say I wanted to imagesearch my name Teckx. Then from there id want to subtract coordinates so the mouse would move to the right and copy the post number which will always be in the same spot. Edited July 25, 2017 by Teckx Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 25, 2017 Share Posted July 25, 2017 @Teckx It's very mechanic... You could you a combination of PixelSearch(), which returns a 1-dimensional array containing the x and y of the pixel found, and from here, you could use MouseMove(), starting from the values returned by PixelSearch(). Why can't you use file read to read the content of a file, look for the word you are passing to the script, and then do all the MouseMove() you need? You should make a step by step video in order to let us comprehend what you're trying to do... And why you are proceeding in this way... Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Teckx Posted July 25, 2017 Author Share Posted July 25, 2017 49 minutes ago, FrancescoDiMuro said: @Teckx It's very mechanic... You could you a combination of PixelSearch(), which returns a 1-dimensional array containing the x and y of the pixel found, and from here, you could use MouseMove(), starting from the values returned by PixelSearch(). Why can't you use file read to read the content of a file, look for the word you are passing to the script, and then do all the MouseMove() you need? You should make a step by step video in order to let us comprehend what you're trying to do... And why you are proceeding in this way... wish I could give you a video that would make things much easier but its classified I haven't really tried pixelsearch much because all of the forms im using are mainly just black text on a white background. Link to comment Share on other sites More sharing options...
Teckx Posted July 25, 2017 Author Share Posted July 25, 2017 heres a sample if it helps at all. Are you creating a New Group or Modifying an Existing Group?* : Create a New Group Enter the New Group Name* : Test Group Capture this Type of Group* : Distribution Link to comment Share on other sites More sharing options...
Teckx Posted July 25, 2017 Author Share Posted July 25, 2017 so looking at that sample id want to copy Test Group Capture this so ive been image searching the Group Name* : and having it mousedown and move towards the border of the form with another imagesearch., is there a better way? Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 25, 2017 Share Posted July 25, 2017 11 minutes ago, Teckx said: so looking at that sample id want to copy Test Group Capture this so ive been image searching the Group Name* : and having it mousedown and move towards the border of the form with another imagesearch., is there a better way? @Teckx I think you could use _IE_* functions, in order to retrieve some information that for sure would be helpful! Did you already take a look at them? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Teckx Posted July 25, 2017 Author Share Posted July 25, 2017 Just now, FrancescoDiMuro said: @Teckx I think you could use _IE_* functions, in order to retrieve some information that for sure would be helpful! Did you already take a look at them? I have not. still a bit new at all this so I tend to stick to what im comfortable with and try to make it work. ill look those up Link to comment Share on other sites More sharing options...
Teckx Posted July 26, 2017 Author Share Posted July 26, 2017 On 7/25/2017 at 10:02 AM, FrancescoDiMuro said: It's very mechanic... You could you a combination of PixelSearch(), which returns a 1-dimensional array containing the x and y of the pixel found, and from here, you could use MouseMove(), starting from the values returned by PixelSearch(). Why can't you use file read to read the content of a file, look for the word you are passing to the script, and then do all the MouseMove() you need? You should make a step by step video in order to let us comprehend what you're trying to do... And why you are proceeding in this way... sorry to bug you. was still thinking about this three things 1: not sure if IE functions can do this but ive noticed the item i want is always on line 52 in the 'view source' unsure if theres a way to pull that while removing all the html surrounding it 2: Could you point me in the right direction or expand on "why can't you use file read to read the content of a file, look for the word you are passing to the script, and then do all the MouseMove() you need?" 3: Same as above, could you point me to more info on "You could you a combination of PixelSearch(), which returns a 1-dimensional array containing the x and y of the pixel found, and from here, you could use MouseMove(), starting from the values returned by PixelSearch()." instead of using pixelsearch however i would have to use imagesearch Link to comment Share on other sites More sharing options...
Teckx Posted July 26, 2017 Author Share Posted July 26, 2017 this thread can be deleted. the solution is so simple $result = _ImageSearch("test.png",1,$x1,$y1,0) if $result=1 Then MouseMove($x1,$y1,3) Mouseclick("left",$x1+200,$y1,1) Else MsgBox(0,"WAS NOT FOUND"," DID NOT FIND IT") Exit EndIf Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 27, 2017 Share Posted July 27, 2017 Happy to see that you solved your issue Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now