Jump to content
Macro Express Forums

Macro Help - Casse/Switch


Tropic

Recommended Posts

Hi,

 

I got a macro that is basically a multiple choice menu of different things to open.

 

Their all check-marks.

 

So basically the user runs the macro and checks off what they want to open.

 

In the Multple Choice menu, I got choices up to letter "N".

 

The problem: The macro hangs sometimes if i choose more then one... This is a huge Case Switch?

 

I was thinking should i break it down to sub routines?

 

Thanks!

Link to comment
Share on other sites

As with all timing, start long and shorten. If Wait for Window Title works that fine. I normally add a short delay after that but in this instance timing is not critical. I played with Case a few months back but found the lack of ifs, buts, maybes and almosts was a bit limiting compared to If statements.

Link to comment
Share on other sites

If you select more than one item, T1 is the sum of the items so if you select A and E, T1 will be AE. You should be using Contains for multiple selections. Equals is fine for single choice. Otherwise, the Ifs will work with the necessary time delays if some apps have heavy startups. I have one macro like this where the first option A is to do the entire list so that looks like:

 

If Variable T1 Contains A

or

If Variable Contains B

Then Open Yahoo

End if

 

If Variable T1 Contains A

or

If Variable T1 Contains C

Then Open Google

End If

 

My time delays are built into each macro (in your case that would be Open Yahoo etc) but putting in the above code is fine.

 

You can pre-seed the Multichoice so if A and E were your normal choices, set T1 = AE before the Multichoice and the selections A and E will be already selected when the box opens. If you want something else you change but it means that normally you just hit OK.

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...
×
×
  • Create New...