sunilvedula Posted October 15, 2009 Report Share Posted October 15, 2009 Hi All, I am finding a text in an screen through the macro express by making it do ctrl F and the item gets hightlighted. Now i want my mouse to move to that highlighted item. Is it possible? Neither tab nor arrow keys work on this screen. Quote Link to comment Share on other sites More sharing options...
rberq Posted October 15, 2009 Report Share Posted October 15, 2009 The only way I can think to do it, is scan and record pixel colors on the screen before the "find". Then scan again after the find, and where pixel color has changed due to highlighting is where you want to move the mouse to. I fear this would be unacceptably slow with Macro Express, if you scan every pixel. However, if you know that a highlighted word will cover a minimum of, say, 20 pixels high by 40 pixels wide, then you could scan in increments of maybe 10 by 20 pixels and reduce the time considerably. (I'm just making very rough estimates here.) It still might be unacceptably slow. The only way to find out would be to write the logic and try it. Shouldn't be too hard to code it. Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted October 15, 2009 Author Report Share Posted October 15, 2009 thanks for your reply. i tried exactly what you said. i estimated my regular area where my data would lie and took approximation of in and around that area which i know it will highlight. so i told my macro to move around the estimated area and look for the highlighted pixel color and then move few points beside and copy the data. this is working fine but my doubt is if i need to look for some thing else which area i am unaware then how do i do? by doing ctrl f (find) if it find how do i my mouse to that area. Any other faster way or anything else? Quote Link to comment Share on other sites More sharing options...
rberq Posted October 15, 2009 Report Share Posted October 15, 2009 i tried exactly what you said. i estimated my regular area ... told my macro to move around the estimated area That is not exactly what I said. I said analyze the whole screen both before and after the "find". But here is a variation on your method of estimating the area where the text will be: Treat the whole window as the "estimated area". First, in order not to have such a large area for pixel checking, use ME commands to re-size the window to be very small, maybe a quarter or a tenth of the screen size. Making it full-screen width, but one-tenth screen height, would be a good starting point for testing. Then when you do the "find" most browsers and other applications will bring found data to within the display window, giving you a much smaller area to search compared to the full screen. No guarantee that it will work, but it's worth a try. Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted October 16, 2009 Author Report Share Posted October 16, 2009 ok will try and let you know... thanks for the thoughts. If there is any better way pls post so that it can help me. Quote Link to comment Share on other sites More sharing options...
Brain Virus Posted October 22, 2009 Report Share Posted October 22, 2009 Sunil here is the demo on parsing data. since the fields are in a set order it should work for you. just have all the text on the screen copied to a variable. Parse.mex Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted October 22, 2009 Author Report Share Posted October 22, 2009 hi i am attaching the notepad of the data look alike. Can you help me out with this. I tried your macro with reqd modification but the postion of N1 always gives me 0. pls help me out. i want the account number customer name, card number, Posted date, Ref Number, POS Entry Mode .... testfile.txt Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted October 22, 2009 Author Report Share Posted October 22, 2009 Hi All, sorry sorry my error. I was storing all the text in variable T1 and searching for the text in T2. silly error. i have now been able to do it. thanq brandon. Once i am done with my complete coding will let you know and post the macro also on the forum Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted October 22, 2009 Author Report Share Posted October 22, 2009 i have figured it out and it works extremly fine and i have put it out for testing on live systems. Need to wait for the results though. For me ti worked fine. I am putting out the code for anyone it might be useful to pull data from webpages where the action of tab and arrow is nullified. Last but not the least a ton of thanks to brandon who gave me this idea. TEST.MEX Quote Link to comment Share on other sites More sharing options...
Brain Virus Posted October 22, 2009 Report Share Posted October 22, 2009 i have figured it out and it works extremly fine and i have put it out for testing on live systems. Need to wait for the results though. For me ti worked fine. I am putting out the code for anyone it might be useful to pull data from webpages where the action of tab and arrow is nullified. Last but not the least a ton of thanks to brandon who gave me this idea. no worries, Hows the deployment? anybody having issues? Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted October 23, 2009 Author Report Share Posted October 23, 2009 Deploying it today and people here are quite excited as it has resolved lot of problems. One issue remains though. If you look at the text file i sent you i am unable to pull the customer name as there is no common identifier. I will have to copy the entire things till Org and then need to subtract the integer values. Can you look and let me know if anything else can be done abt it Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted October 29, 2009 Author Report Share Posted October 29, 2009 hi , all problems reslved. able to copy everything. thanks. the sol works miracles but is it possible to count if how many times is a particular text repeats itself in the variable? i was able to do it by deleting the text i found and then counting again the same putting it in a repeat loop. it works fine. but is there a better alternative solution rather than this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.