rberq

Members
  • Content count

    643
  • Joined

  • Last visited

  • Days Won

    29

rberq last won the day on July 7

rberq had the most liked content!

Community Reputation

11 Good

About rberq

  • Rank
    Expert

Contact Methods

  • ICQ
    0
  1. 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.
  2. 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 ....
  3. 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?
  4. 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
  5. 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.
  6. 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.
  7. This appears to be a duplicate post. Replies are in the other thread.
  8. 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).
  9. 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 //
  10. 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.
  11. 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
  12. 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.
  13. 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.
  14. 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 //
  15. 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.