Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,200
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. "Run Macro in Variable" looks like a good way to initiate the called macro. Sorry, I only have ME3 installed so I can't check, but does that command have a wait-for-completion option? If not, you could use a global variable to signal completion: (1) Main macro sets DoneProcessing variable to zero, then initiates called macro. (2) Main macro loops (Repeat loop) checking DoneProcessing variable for value of one rather than zero. (3) Called macro does its thing, sets DoneProcessing to value one, exits. (4) Main macro sees DoneProcessing value of one, exits from Repeat loop and continues processing. Obviously, you can name your global variable anything you want -- DoneProcessing is not a keyword within Macro Express as far as I know. If you use this technique, be sure to put a brief delay within the Repeat loop so it doesn't hog all the processor time -- one-tenth second (100ms) usually works well. Also put some error logic within the Repeat loop -- for example, if it doesn't see the DoneProcessing value within 5 seconds (50 repeats with 100ms delays), then display an abort message and halt the main macro. This allows for a called macro that fails or "forgets" to set the DoneProcessing value.
  2. Often when you want to allow for uncertain delays, you can pick a spot on the screen that you KNOW will change when the desired action completes. Use a repeat loop (with MANY repeats) to check for change of pixel color at that spot, then exit from the loop when it changes. Include a 100ms delay within the loop, which pretty much takes care of different speed computers. For example, repeat 1000 times with 100ms delay allows a (nominal) 100 seconds for the action to complete, but the macro will continue immediately when it does complete, be it one tenth of a second or the full 100 seconds. Of course if the 100 seconds elapses and the action still has not finished, you are SOL, so you have to program for that and display a text box error message and abort the macro. But for this situation Cory's method is better. Play with substrings a little and you may find it's easier than you think.
  3. If you really have only 100 files, and this is a one-time thing, then don't bother coding the macro to progress through all 100 files. Alan's model macro already arrows down in Windows Explorer to highlight the next file, so just set up a hot key to start the macro again manually. It won't take much extra time to hit the key 100 times, and it will save you significant coding effort. In fact, I would be tempted to break Alan's code up into two separate macros: first (hotkey) macro to do the find and paste -- then you eyeball it to make sure it has really done what you want -- then second (hotkey) macro to save the modified file and arrow down to the next file in Explorer. I say this because, whereever you build in time delays, there is the possibility of Windows screwing things up with an unusually long response time. Better you should do a quick visual check on each file before saving it, so if something has gone wrong you can cancel out without saving and start over with that file. If you were doing 10,000 files, no, but with only 100 play it safe.
  4. That's easily remedied: It is fny hwevr bcus I've bn crtcizd fr bng too wrdy.
  5. Once Anagram.txt is saved, read it and write Anagram_2.txt. Delete lines by NOT writing them to Anagram_2.txt. When Anagram_2.txt is complete, display it by calling Notepad with Anagram_2.txt as the parameter. Not fancy or especially elegant, but simple and should be plenty fast enough so your son won't fall asleep.
  6. Look at the Launch and Activate command under Windows/Programs. You can launch a program and pass it parameters. Then maybe have your macro wait in a Delay command or a Repeat loop (with delays built in) until the launched program finishes -- either wait a specified time interval or for the program to create a file or Registry entry containing its results, or something of the sort. Then retrieve the results of the launched program and continue processing.
  7. It is kind of a hidden feature -- not really hidden, just hard to find. Variable Set String command with the "Prompt for value" option.
  8. I start ME with a desktop shortcut rather than have it start automatically at boot. One property that can be set for the shortcut is "Run as administrator". I run Windows 7 and ME 3 -- so not quite the same as what you are asking, but maybe it will help.
  9. There COULD be any number of features. But how complex do we need ME to be, simply to handle situations that don't commonly occur? I'm thankful it does all that it does, and you can program around these oddball situations.
  10. ME version 3 does not like the quotes around the path and program name, but is happy with embedded spaces in the path and program. So, try C:\Program Files (x86)\MyLifeOrganized.net\MLO\mlo.exe (no quotes) for program/path name, and the rest of your options (with quotes) as program parameters.
  11. I think you will have to do as Samrae says, use Pause to kill the running macro. Suggestions others have made, to have the macro kill itself based on a registry or file or variable flag, are fine and are suitable for many situations. But if your macro has called on File Explorer to do something, and Explorer does not return control to the macro, then the macro can't kill itself because it is not in control.
  12. You may not LIKE having extra macros, but based on your testing that's what you will need in this case. Personally, I DO like having extra macros if that provides the level of control needed. Even if multiple macros would run based on program and window focus, could you be sure which one would run first? Just accept that you need an extra macro, and don't keep beating your head against the wall.
  13. Could you have a small controlling macro that runs for the FIREFOX program and makes all the decisions? The controlling macro would check window title, run one or more other macros in the appropriate sequence, then exit. The other macros would not need to be program or window specific, and would not need to check window title, because all that would be done by the small controlling macro.
  14. How do you do the straight lines? I'm guessing you use the straight-line feature of the art program -- you have ME position the mouse to the beginning point, press and hold the mouse button, move the mouse to the end point of the line, and release the button -- or something akin to that technique. The hard part of that would be translating your x-y coordinates to pixel locations so ME can move the mouse properly. Same thing should be possible with the free hand drawing feature of the art program. As Alan says, have ME calculate the x-y coordinates of successive points on the curve, translate those to pixel locations, and move the mouse from pixel to pixel. Easier said than done, but I don't know how else you would do it except to feed appropriate parameters to the art program for whatever standard shapes the program supports.
  15. Sorry, I would need to have your application screens on my PC along with your macro.
  16. I am guessing that the typing done by the macro is getting out of sync with the screens being typed into??? So the macro keeps right on typing, but maybe the next screen is not yet ready??? Situations like that are frustrating to automate with Macro Express, because no matter how many delays you introduce, eventually Windows is busy doing something else and the application doesn't respond fast enough. Or else you have such long delays that it takes forever to run the macro. If that's your problem, you could add some logic to detect when the application screen changes, and don't let the typing continue until the screen change occurs. Generally I find a spot on the current screen that will change color on the subsequent screen. Then write a repeat loop that checks pixel color at that location, and exit from the loop only when pixel color changes. Each pass through the loop should include a 100ms delay (1/10 of a second). *** Done typing into first screen *** Get Pixel Color into variable N1 Repeat 1000 Get Pixel Color into variable N2 If N1 <> N2 then exit from repeat (screen has changed) Endif Delay 100ms Repeat *** *** at this point either screen has changed, or 10 seconds (1000 repeats) have elapsed If N1 = N2 then display text box "Error -- Time elapsed but screen did not change" Macro Return Endif *** Text type into next screen P.S. At beginning of your macro, set a keyboard delay of something like 30ms, so the keystrokes don't occur quite so fast.
  17. I see what you mean -- Macro Express seems to be deactivated in the Remote Assistance screen. Mouse Locator doesn't even recognize where the mouse is when it's over the RA window. If you type into Google "batch command to initiate windows remote assistance" there are some command-line options that can be used to start Remote Assistance. Options differ depending on the version of Windows being used. If you can build a batch file on your Mom's computer that works for RA, then you could set up a hot key for her to run a macro, and the macro would run the batch file.
  18. When I put that syntax into a batch file it works fine when ME is already running. If ME is not already running when the batch file runs, ME starts up and then the macro runs. If I use an non-existing macro name, ME starts up but no macro runs. If wonder if you might have a path problem, where ME can't find the macro file? My macro file is in the same folder as all the ME executables. I hope that helps ... maybe a clue there.
  19. Here's an idea. Have your macro do all the evaluation of what is to be moved and where, but don't have the macro actually do the move. Instead, have it write DOS "move" commands to a text file. After you review the text file for accuracy, rename it as a .BAT file and run it.
  20. [Additional] Macro 3 runs at ME startup, stores date and time in an environment variable. Macro 2 runs on hot-key, does its thing, then stores date and time in [the same] environment variable. Macro 1 runs every 1 minute or 5 minutes or whatever, depending how precise you want the 90 minute alert interval to be. When it runs, Macro 1 checks current date and time against the stored value. If 90 minutes have passed, sound the alarm and store a high future date and time in the environment variable. If ninety minutes have not passed, just exit from Macro 1 with no further action.
  21. Ditto what Alan said. Withing limits, keystrokes have the advantage that Windows MAY buffer them so you can feed them to Word faster than it can process them, which simplifies timing (see below). For testing/debugging, after each mouse move use a ME text box to display where you have moved it to, instead of having ME click the mouse. Then you can move and click the correct spot manually, so as to continue through the process and take more notes. You may have to insert delays so Word can respond to a mouse click, before you continue to the next click. Often time delays will not be reliable because Windows will respond faster or slower depending what else it is doing. In cases where the screen changes you may be able to check pixel color at selected places to wait for the screen to change, so you will not be clicking the wrong screen.
  22. Shouldn't DEFAULT CASE precede END SWITCH? Though I don't see why that would cause your problem, unless the macro compiler gets mixed up by the out-of-place statement.... It's worth a try to move the DEFAULT CASE, or eliminate it entirely at least for testing. Macro Express 3 only allowed the first 36 options A thru Z and 0 thru 9. So you might be looking at a bug where ME Pro is erroneously still stopping after 36 tests. Are you on the latest version of ME Pro, and/or have you checked with product support on this problem?
  23. With some web pages, I have had ME do a Ctrl-a to highlight all text on the page, then copy to clipboard and transfer to a ME text variable. Then you can scan the whole text string looking for "Yesterday's Calls" or whatever other words delimit the beginning and end of the data you want to extract. Whether it works or not depends a lot on how the page is presented. Sometimes the page is in sections, and you have to click on the right section before doing the highlight/copy-to-clipboard. You can test in a few seconds to see if it will work, by manually doing the Ctrl-a and Ctrl-c, then paste into Notepad and see what you have.
×
×
  • Create New...