Jump to content
Macro Express Forums

Pixel question


patgenn123
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...