Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,203
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. Can you post a screen shot of the Set Schedule box for your macro? Also what did you specify in the Scope tab for the macro? Also ME Options | Preferences | Scheduler settings?
  2. Set your scheduled macro to run every second or two seconds. Adjust ME preferences so the Scheduled time is at least as short as the macro's interval. When your scheduled macro runs, check an environment variable or something of the sort which contains your preferred page-turn interval. Based on time, if the interval hasn't yet elapsed, don't hit the page down key. Write two new macros triggered by the (+) and (-) keys, who job is to bump up (or down) the page-turn interval stored in the environment variable. Instead of checking time, you could hit page down every time through the scheduled macro, or every second time, or third, or tenth or whatever. Or have a never-ending macro that loops indefinitely (Repeat loop) with an embedded adjustable delay each time through the loop. Still requires storing some sort of status or interval by means of other macros triggered by (+) and (-). But why would you want a feature like that? Reminds me of a speed-reading class I took, where a sliding shutter came down over the page line by line to force you to stay concentrated to keep ahead of it. It worked, but reading was no longer any fun.
  3. Since you are using a message box, could you instead use the "Multiple Choice Menu" Dialog? I do have a possible solution for the situation you as presented it, but it is way more complicated -- have your primary macro start two other concurrent macros, one that waits for A and one that waits for E, and code a Repeat loop in the primary macro waiting for a signal from either one of the waiting macros. You can wait for "Any key" to be pressed. It's too bad Macro Express doesn't insert the pressed key into a text variable -- then you could check whether it is A or E and re-issue the wait if not.
  4. Thanks for the notice. Still happily running ME version 3.
  5. ME essentially does keyboard actions and mouse commands, and they apply to the active window. So I don't think it can do what you want. For your sake, hopefully somebody will prove me wrong! If you have a dual monitor; or if you can shrink the Explorer window down to a small footprint that shares the screen with your active application, it could work. But your active window would briefly lose focus while Explorer is active.
  6. Yes, Sam. Simpler than my routine and should be just as effective. I still recommend trimming the remaining title.
  7. If the data is consistent -- that is, name portion is exactly the same in both databases -- perhaps you could use the length of the name. Variable Modify String: Right Trim %T72% (get rid of trailing blanks in name) Variable Set Integer %N72% from Length of Variable %T72% (length of name into variable N72) Variable Modify String: Delete Part of %T73% (starting position 1, length N72) Variable Modify String: Trim %T73% (get rid of leading and trailing blanks in title) If the names are not identical between the two databases, it becomes vastly more complicated.
  8. See if you can struggle through making my macro or acantor's work for you. You will learn a lot. If you give a man a fish you feed him for a day ....
  9. Very clever! Thanks for posting this. So, are you saying this works without the Program Manager screen temporarily replacing JPEGView? Or do you mean Program Manager flashes up and is replaced by JPEGView so quickly that it is no longer a problem?
  10. This macro will search a rectangular area. The "rectangle" can be as simple as a single horizontal or vertical row of pixels depending on how you set the upper-left and lower-right boundaries. There is no error checking in the macro -- if you exceed the limits of the screen, or specify a bottom-right point that is above or left of the top-left point, results are not guaranteed. The first Mouse Move command makes the mouse track the pixels being checked, which is handy for testing because you can watch the search pattern. That Mouse Move should be inactivated for normal usage as it slows the macro down considerably. Log Message to Default Error Log Log Errors // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Keystroke Speed: 30 Milliseconds Mouse Speed: 30 Milliseconds // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // // This macro is intended to be called from another macro // Macro searches rectangular area for specifie pixel color, puts mouse on first pixel found // // Variables passed from caller: // .... %N90% and %N91% Top left corner of area to be searched (screen relative) // .... %N92% and %N93% Bottom right corner of area to be searched (screen relative) // .... %N94% Pixel color to be located // // // For testing set up coordinates normally passed from calling macro Variable Set Integer %N90% to 800 Variable Set Integer %N91% to 500 Variable Set Integer %N92% to 850 Variable Set Integer %N93% to 500 Variable Set Integer %N94% to 6956042 // // // Copy search area coordinates to working variables Variable Modify Integer: Copy %N90% to %N20% Variable Modify Integer: Copy %N91% to %N21% // Search until pixel color found or until area boundaries exceeded // Search proceeds left to right in a row, then drops to next row, etc. Repeat Until %T1% <> %T1% // For testing move mouse to next pixel to be checked Mouse Move Screen %N20%, %N21% Get Pixel: Screen Coords: %N20%,%N21% into %N24% If Variable %N24% = variable %N94% Mouse Move Screen %N20%, %N21% Repeat Exit End If // Bump pixel coordinates Variable Modify Integer: Inc (%N20%) If Variable %N21% = variable %N93% AND If Variable %N20% > variable %N92% Repeat Exit End If If Variable %N20% > variable %N92% Variable Modify Integer: Inc (%N21%) Variable Modify Integer: Copy %N90% to %N20% Else Variable Modify Integer: Inc (%N20%) End If Repeat End // // // // Macro Return
  11. That would be a handy feature to have. You could write a macro to do it, that could be run (called) from any number of other macros. The calling macro would simply pass the starting location and dimensions of the search area to the called macro (in variables), along with the color to be searched for; with results returned in another variable. One scan of a 100x100 square is fairly time-consuming -- perhaps a second on my PC running Windows 7 and ME 3. There have been recent threads on this forum complaining of MUCH longer pixel-check times on Windows 10 systems, indicating such an extended search must be done in some other computer language than Macro Express and might not be feasible even there.
  12. I have noticed if you do a copy or move, then right clicking gives you the option to undo that copy or move -- it does not revert to the the last delete. If you undo a delete then right click, you get the option to re-do the delete (or copy, or move). So it is context-sensitive to your last action, and could quickly degenerate into who-knows-what if you are not watching closely. Perfect is the enemy of good. At this point you are good. Be satisfied.
  13. This appears to be a duplicate post. Replies are in the other thread.
  14. To enter ‘1’ in a cell, you typically press the ‘1’ key, then ENTER or TAB or ARROW DOWN or something of the sort. That completes the data entry and moves to another cell. So you could try this: 1) Trigger your macro with a function key, like F1, or whatever other trigger you like (but NOT ‘1’ or ‘2’, etc.) 2) Type the value into the cell, then trigger the macro with your chosen hot key. 3) The macro types ARROW DOWN to complete the data entry and move down one cell. 4) The macro then types ARROW UP to return to the cell just entered. 5) The macro types CTRL-c to copy cell value to clipboard. 6) The macro evaluates the clipboard value, then performs the appropriate ‘1’ or ‘2’ function as you coded in your examples, depending what is in the clipboard. All functions to be performed by the one macro, with a series of IF CLIPBOARD EQUALS tests. If a value was entered that you don’t care about, macro doesn’t do any more typing. The macro is not really "listening" for the key entry as you wish, since it requires the hot key to initiate the macro after typing the value. The only other way I can think of is to keep the individual macros as you have them, but limit their scope to Excel or to the specific spreadsheet you are working with (based on window title perhaps).
  15. When you enter the command IF VARIABLE %T[n]% = you must NOT type the double-quotes in the value (comparison) field. That is, to compare to an empty field, you type nothing at all in the value field. You do not type “”. Similarly, to compare to a single blank, you type a space in the value field, you do not type “ “. At least that’s the way it works in ME version 3. Can’t tell if that is your error or not, from what I can see in your message. The file processes as you want it to on my machine – that is, field 7 is empty on most lines as far as ME is concerned. // ASCII File Begin Process: "test.csv" (Comma Delimited Text ) Text Box Display: %T1%,%T2%,%T3%,%T4%,%T5%,%T6%,%T7%,%T8%,%T9%,%T10%,%T11%,%T12%,%T13%,%T14%,%T15%,%T16%,%T17%,%T18% If Variable %T7% = "" OR If Variable %T7% = " " Else Text Box Display: T7 contains data End If ASCII File End Process //
  16. I have seen Windows-automation programs that do similar functions to ME, even better, but instead of buying them outright for $45 I can lease them for $100,000 a year. Hmmmmm. Lemme think. Which one should I get for navigating a few screens to check my credit card balance? As for professional outcomes, I have written LAN-based ME systems used by hundreds of simultaneous users, monitoring and responding to and interfacing among dozens of unique application windows. All that was after the "long, long time ago" that you say ISS gave up.
  17. You are close, but the IF needs an END IF. Structurally the code below should work and should not produce an error diagnostic. Logically your instructions check the pixel color variable twice: (1) in the REPEAT UNTIL line and (2) in the IF VARIABLE EQUALS line. You don’t need to check it both places, because either one will exit from the REPEAT loop and go to the TEXT TYPE instruction. Repeat Until Variable Equals Get Pixel Color into Variable If Variable Equals Repeat Exit End If Delay 2 Seconds Repeat End Text Type Text Type
  18. Ah! Thanks for the visuals. Do you have to actually grab the slider with the mouse and drag it, or can you just click the mouse on the right hand end of the slider scale? For example, playing a YouTube video either method works to get to the end of the video. Or, I can click anywhere on the scale line and the slider jumps to the mouse-clicked position, where it can then be grabbed and moved.
  19. I notice your original post mentions moving about 220 pixels. Can you get closer on the original positioning of the mouse, so it doesn't have to scan so far? I have done that on a couple of pixel-color searches, to speed up the macro.
  20. I have a few macros where I move the cursor and watch for it to change format, rather than looking at pixel color. For example, changing from arrow to finger when it reaches a URL. Here’s a loop watching for the vertical beam to change to something else. I don’t know if that would be any faster for you, or feasible for what you are trying to accomplish. It is easy for the mouse to overrun the macro if you move it too fast or too-large increments. The routine below fails perhaps 2% of the time because the mouse moves past its target before Windows changes the format. I use Windows 7, not 10. // // Scan down until mouse cursor is no longer vertical beam. Repeat Start (Repeat 125 times) Mouse Move Position 0, 3 Get Mouse Position Screen: %N47%, %N48% // If we run past the bottom of the screen, abort macro. If Variable %N48% > 720 Text Box Display: Screen limits exceeded Macro Stop End If Delay 15 Milliseconds If Mouse Cursor is Beam Else Repeat Exit End If Repeat End //
  21. With complex macros I have built in many logging commands for debugging, but usually have a switch I can turn on or off so the logging is bypassed under normal situations -- just turn it on when I am having a problem. I have never used Log All Commands -- seems like it would be useful in some cases, but extremely time-consuming to read through the trace looking for a problem. For a macro that runs really long or really frequently, I would fear the performance impact. For one that runs only once in ten minutes, like you describe, minimal impact to write a few or a few hundred lines to the text log file. Note I only recommended that, as a start, you scatter some log commands through the macro to isolate the general area where it is hanging up. Sounds like you have made a good beginning by determining that the problem is not with the scheduling component of ME.
  22. I’m confused. You say the macro “fails to run”. Do you mean that the macro fails to start; or that it starts but fails to accomplish the intended file save? Those are two very different issues. I have found scheduled macros start reliably. All my macros have this as the first line: Log Message to Default Error Log where the “message” logged is the macro name. So it is very easy to look back on the ME log and see every time it starts. You could easily embed additional log messages at critical points in your macro to see how far it gets before hanging, if that is what is happening.
  23. Yes, same here. Then a macro ran more or less constantly scanning screens to see whether the pixel colors/positions matched with the coordinate file. That would identify which screen was visible, and call other macros to process the screen. Users with slower computers told me they didn't like it because whenever that application was running the CPU cooling fan would come on and make too much noise.
  24. Anchor points -- excellent idea. The script to record anchor points shouldn't be too hard to write. I have done something vaguely similar to record pixel colors of unique points on a series of identically-named web screens, so a subsequent macro can determine which specific screen is currently present. I found the easiest method was to position the mouse by hand, then trigger the recording macro via a keyboard key. If I positioned the mouse then clicked, the clicking jiggled the mouse just enough that I often recorded the wrong location.
  25. acantor sounds pessimistic, but he is absolutely right. The best Macro Express can do with Windows and especially web forms, is to be almost 100% reliable. It is great for automating personal tasks at work -- I always said it was worth half a person as a time saver. You can even roll it out to dozens or hundreds of users, but not to dummies. You/they have to watch carefully as the macros run and recognize when ME has gone wrong.
×
×
  • Create New...