Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Posts posted by Cory

  1. It seems like the "System Event" activation with the WM_LBUTTONDBLCLK message should work, but I've never been able to figure out how to use the feature. Paul knew how to do them. I even see an old post of his here with mention of one. It's one of the least mentioned activations in the forum and the least documented. I'd like to get one of these to work someday. I think I'll look into it more this afternoon.

  2. I don't think MEP is designed to do such a thing. My first thought would be to watch the Windows messages for an event. I've never tried it. I think this might be the message you woudl want to look for.

    Or maybe have a macro with a single click activation that has a short delay, that being the period between the two clicks, and when it's run the next time, see if it's running or not. If the macro sees that the macro is running, then do what you want. But I can't remember if one can run a macro concurrently like that. But maybe some kind of trick like that. 

    Maybe the first time it runs it puts a time stamp in the registry and on the second time it runs if less than a specified time has elapsed, then consider it a double-click and run the rest of the macro. I'm not sure it woudl be quick enough though. Depends on the period. A fast double click might not work. Something weird like that. 

  3. General thoughts:

    • I don't like the macro recorder becasue I would experience similar frustration in cases like this. I advise all newbs to get into directly writing their macros as soon as possible. I advise you look at what it has recorded but also think of how you do it and write the code yourself. 
    • Avoid using the mouse.
    • Try writing a test macro as simple as possible that only attempts to do one thing. Keep it as simple as possible and make it independent. Then post it and a sample spreadsheet if necessary here so we can look at it and experiment. 
    • Check out F5 "Go To". 
    • Ctrl + Space selects and entire column, Shift + Space selects an entire row. Delete will delete the contents. 
    • Ctrl + Shift "+" inserts a row. Ctrl + [minus key] deletes the entire row. Click here.
    • In general, explore all the keyboard shortcuts in Excel. 

     

  4. It's been a while since I worked in the old MEP, so I might get some things wrong.
    I would first use Text File Process and count the number of lines and store in an integer variable. Then create an integer variable using Set Random Variable, or whatever it's called in ME. Then use text file process command and use the "Start at" with your random number and set the "Number of Records" to 1.

  5. LOL. One thing that I like to point out for people is that dates are essentially a decimal with formatting options. 1 = 1/1/1900. So if one can't find an extant function, one can make or treat it like a decimal to do whatever is needed. For instance in the past I've had problems showing things the way I want like total hours, colon, and minutes. So I just break it up, multiply by 24, multiply the remainder by 60 into a different variable, and output they two with a colon between them. This way I can show something like 123:45. 

  6. Then ignore all I wrote about using controls. The WebBrowser is one big control. 

     

    MEP is a great program but it's not well suited for some web page automation. You could do more with iMacros, but then it means learning a more difficult programming language. 

     

    Sometimes tabbing though a page and using the spacebar can toggle these. 

  7. Not that I know of. Not in the way you're hoping. 

     

    I've not tried it but using the Variable Set Boolean command there is an option to set "If Control" and "Is focused". If the radio button several from the other buttons, that is a separate control, and it's focused when in this state, then one could detect this. 

    Also there's a Get Control Text. There is no text in a radio button, but it might show up as zero and negative one indicating true or false. BTW the text "Carbon steel" is the label and I don't think MEP woudl return it. 

    Also if you use the "Windows Controls" commands you might avoid the problem altogether. MEP Windows Control commands are always the first thing I try. I only resort to keystrokes and such if I can't do it with control commands. If you haven't learned them yet, you should. 

    Hard to experiment with MEP control commands without having access to your program. 

    If this is a web page or a UWP app control commands are useless.

     

    You could also get the position of the control and Get Pixel Color relative to the control position to detect if it's blue or not white.

  8. There is nothing like a timer object in other programming languages. Much as you say when doing things like this one should always have a delay in the loop, say 1 minute or even 1 second. Just something to keep the loop from hammering your processor by running as fast as it can resulting in thousands of iterations a second. In practice if I want to check somehting for a limit of 30 minutes I'd just have a 1 minute delay and do 30 iterations. However there is some time to do the process so the actual time will be longer. In most cases I find this is not important. In cases where it was important or the process could run a long time, I'll creates a time variable for now, add 30 minutes, then in my loop have an excessive number of iterations but check each time if we are past the time limit in the variable.

     

  9. How you manage a token depends on what you are doing and how you want to manage them. I could only waste time wildly speculating. Give us some idea of the flow and control and maybe I could give you some ideas. I think the last one I did the master would check multiple registry values in a loop with a one second delay if it needed to react quickly, and as a scheduled macro if it was longer than a few minutes.  

     

    I don't understand "Is there no time variable to work with?" There are time variables in MEP, but it sounds like you probably know that already.

     

    I don't know if you know this or not but macros can be created that are used like subroutines or an object in a OOP language. Back when I was writing a lot of macros I'd have large categories (as called in Macro Explorer) of macros that would be passed a variable and then do general purpose task, say sorting an array. This way I could use those function/subroutine macros in many macros. If you get into this there's some things you should understand about the scope of the variable. You can ask us then for an explanation. I think I still have a web page on that topic someplace...

×
×
  • Create New...