Jump to content
Macro Express Forums

Read Items In A Context Menu


Recommended Posts

I have a macro which reads a list of account numbers and notes from a text file and inputs them into a customer service system. The notes screen in the CS system is launched from an icon in the toolbar. This works great for customers that only have one account, but if they have multiple accounts clicking on the notes button brings up a context menu containing a list of accounts. I need to be able to loop through this list and match up an account number. How do get the text of a single context menu item? Here's what I have....

Capture Control to %C1%                                   //Toolbar button
Mouse Left Button Click
Delay 2 Seconds
Mouse Move Position 10,20                                  //Check for context menu
Capture Control to %C2%                                   //Capture control under mouse
If Control %C2% Visible                                      //Not always there
   Repeat Until %N99% = 1                                 //Infinite Loop
       Variable Get Control Text %C2% to %T4%   //Get menu item text???
       If Variable %T4% = Variable %T1%             //If it matches my account....
           Repeat Exit                                             //Break loop
       Else                                                            //If not....
           Mouse Move Position 0,20                         //Move to next item
           Delay 2 Seconds
           Capture Control to %C2%                        //Capture control under mouse
       End If
   Repeat End
End If

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.

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.

  • Create New...