cyberchief Posted March 24, 2005 Report Share Posted March 24, 2005 I am working on the issue of getting controls in the programs we use here. The Macro that I am working on is same as the ones you see in the other threads I have posted. I am running a process that sends mailings out. It pulls the account number from a spreadsheet, and depending on the first 3 digits, decides which program to use. There are 5 programs. All of them exactly the same but are used for the different regions. Here is my question. I found a button control at the bottom of these programs with text. I was having issues when I input information, the program sometimes hangs... and the delay I have set is not always long enough. Well, the control text changes to "busy" when it is waiting. I have found that I can probably use a repeat to delay the macro until "busy" is no longer displayed. Here is what I have: Repeat Until %T1% Does not contain "Busy" Get Control %C1% (OSCAR_EAST_SO - USWest Connect: msctls_statusbar32) Variable Get Control Text: %C1% to %T50% If Variable %T50% does not contain "Busy" Break Else End If Repeat End My question is... I don't want to have to put this code in 5 times for every delay since we have 5 different programs. Does anyone know if I can change the "OSCAR_EAST_SO - USWest Connect" to a variable in the Get Control text? I have the macro set up to set %T50% variable as the program that is being used. All 5 programs have the same name of control (msctls_statusbar32). Will it work by just putting the variable in the Get Control Window Title? TIA!!! Quote Link to comment Share on other sites More sharing options...
cyberchief Posted March 24, 2005 Author Report Share Posted March 24, 2005 I tried it using a variable for the top window control title but it does not seem to be working. I get an error that specified control C1 cannot be found, aborting Macro. Here is the code I am using: Repeat Until %T50% Does not contain "Busy" Get Control %C1% (%T5%: msctls_statusbar32) Variable Get Control Text: %C1% to %T50% If Variable %T50% does not contain "Busy" Break Else End If Repeat End whereas, %T5% is the program in current use (1 of 5 different programs depending on the account number being used). Any ideas? Quote Link to comment Share on other sites More sharing options...
joe Posted March 24, 2005 Report Share Posted March 24, 2005 Cyberchief - I don't think that using Get Control inside the Repeat loop actually does anything. In other words, Get Control only needs to capture a control one time. Putting it in a loop would be like continually setting a variable to the same value every time the loop repeats. Is the Get Control Using Text checkbox checked in the Get Control command? If so, then this may be part of the problem because Macro Express will not be able to find it until it says "Done". Can you email a PrntScrn of one of five of the program windows? Do not post it. Just email it to me joe@pgmacros.com. It might help to envision what you are looking at for this, and some of your other posts. Also, you can change the window title of a control. In other words, you can change which window title a control belongs to. It means that you would only need to Get Control once in your macro. Look into the Modify Top-Level Window Title of Control option. Quote Link to comment Share on other sites More sharing options...
cyberchief Posted March 25, 2005 Author Report Share Posted March 25, 2005 Thanks much! And email sent. I did see the "Modify Top-level Window of control" option... but before I mess with that, I need to see if I can even get this to work. 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.