patgenn123 Posted December 21, 2007 Report Share Posted December 21, 2007 I have a program that I can get the mouse to move to a menu bar and click on the icon to perform the action. What's weird is sometimes the icon is not in the same place in the menu bar! Sometimes another icon in the menu bar is there and it clicks on that icon instead. It's weird and I don't know why it does that. However, I want to try to understand "get pixel". The question is: If I use get pixel, will the mouse travel to the pixel instead of the location? This would make it more accurate because it wouldn't matter if the original icon has moved over a spot, but rather it would search for the pixel color instead. Is my understanding of pixels incorrect based on the logic above? Pat Quote Link to comment Share on other sites More sharing options...
stan Posted December 21, 2007 Report Share Posted December 21, 2007 Pat, The Get Pixel Color command looks at specific coordinates on the screen and finds the color value for that specific pixel. You would then use the If Variable command to do a comparison to see if you have a match or not. If you are trying to click on an icon in the System tray, the icons located immediately to the left of the clock, you can use the Mouse Move to System Tray command. This moves the mouse over the icon that you select. It doesn't matter if the icon has changed positions. Then issue a Left Mouse Click or Right Mouse Click. Stan Quote Link to comment Share on other sites More sharing options...
patgenn123 Posted December 23, 2007 Author Report Share Posted December 23, 2007 Stan, Thanks! Can you or anyone help with a little hint on how to do this? The icon is not in the tray. It is a menu bar icon. How do I target those pixel color(s) so if the icon moves that the mouse would follow it? All I need is some direction... Thanks! Pat Quote Link to comment Share on other sites More sharing options...
patgenn123 Posted December 26, 2007 Author Report Share Posted December 26, 2007 Hi everyone! I am still trying to figure this out. How can I get the mouse to follow this icon? For some reason the icon moves on the menu bar and I need Macros to move the mouse to whatever location the pixels are underneath no matter where it goes. Can someone help please? Pat Quote Link to comment Share on other sites More sharing options...
stan Posted December 26, 2007 Report Share Posted December 26, 2007 Pat, Sorry, I guess I misread your original question. I don't know of an easy way to find a moving icon on a menu bar. The only thing I can think is to use the Get Pixel Color command and have the macro check a specific pixel under each icon. After getting the color of the first pixel, use the If Variable command to see if it is the correct icon. If so, move the mouse to the coordinates and click, or do what you need. If not, move to the coordinates under the next icon and repeat the process until finding the correct icon. This will work if the moving icons are all the same size. If some are wider than others and they switch positions, then the above method will not work. Stan 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.