Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,200
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. Could you show a few lines of the CSV file as an example? Does the file contain multiple user IDs, or is the entire file for a single user only?
  2. Like Cory, I prefer to write lots of trace information to the log file. For example, you could break up your code into logical sections, numbered sequentially. Put a comment line at the beginning of each section, containing the section number. Right after the section-number comment, write a generic "entering section xxxx" trace message to the log file. Also include the section number in each of the error text box displays so you will know right where it failed. For normal operation vs. a debugging situation, you can turn the trace logging on and off. Just define a variable -- TRACE for example -- at the beginning of the macro and set its value to zero (no trace) or one (trace). Then at the beginning of each numbered section, the logic would be: IF TRACE = 1 WRITE SECTION NUMBER TO LOG FILE ENDIF You could do the same to activate/deactivate the diagnostic text boxes: IF TRACE = 1 DISPLAY TEXT BOX ENDIF When you need to debug (or not), simply change the single line at the start of the macro setting TRACE to 1 or 0. Lots easier than going through thousands of lines of code activating or deactivating logging commands and text box displays. It takes some initial effort to set it all up, but in the long run you will save effort.
  3. Echoing what terrypin said, I have never found Window Activate to be reliable. I was about to suggest finding some totally different way of doing the activation, but I see you have already done exactly that. Congratulations. Must be an immense relief after all that frustration.🙂
  4. Odd. The only problem I have had with the mouse locator is when I have accidentally used window-relative instead of screen-relative, or vice versa. Glad you have it working now.
  5. If the Meta-Correction button is always at the same spot on the screen, could you do something as simple as this? (Use the macro editor's Mouse Locator tool to find the screen coordinates of the button.) Mouse Move: 1279, 221 Relative to Screen Mouse Left Click
  6. That's exactly right for the Variable Modify String command -- the details didn't show up when I copied the command text, but I thought it would be good for you to figure it out. 🙂 You could probably modify the macro to handle multi-digit strings, but of course you would have to use some kind of delimiter between strings like Cory said.
  7. Play around with this. I think it does what you want, or close to it. This is written in Macro Express 3; if you have the PRO version you can name the text and integer variables instead of using the standard "T" and "N" names. // Set input string for testing Variable Set String %T1% "123" // Clear output string to null Variable Set String %T99% "" // set integer with length of input string Variable Set Integer %N1% from Length of Variable %T1% // Append input characters one at a time to output string, with comma and blank after each (except last) Variable Set Integer %N99% to 1 Repeat Until %N99% > %N1% Variable Modify String: Copy Part of %T1% to %T89% If Variable %N99% = variable %N1% Variable Modify String: Append "AND " to %T99% End If Variable Modify String: Append %T89% to %T99% If Variable %N99% < variable %N1% Variable Modify String: Append ", " to %T99% End If // .... bump pointer to next input digit Variable Modify Integer: Inc (%N99%) Repeat End // // If input string only two digits, get rid of the comma before the AND If Variable %N1% = 2 Replace ", AND" with " AND" in %T99% End If // If input string only one digit, get rid of the AND as well If Variable %N1% = 1 Replace "AND " with "" in %T99% End If // // Display result Text Box Display: Output string Macro Return //
  8. A great puzzle. I can see I will be thinking about it all day, and greatly annoying my wife by ignoring her and everything else. If I can invent anything, I'll reply again. 🙂
  9. Trigger the counting macro when the entry screen appears. Then: // Variable Set Integer %N1% to 0 Repeat Until %N1% >= 6 Wait for Key Press: Any Key Variable Modify Integer: Inc (%N1%) Repeat End Text Box Display: xxxxxxxxxx (done, so start whatever other macro you want to run) //
  10. This might work: Step 1: Replace all CR/LF with "!@#$%^&" or some other such visible (or non-printable) string that will never occur naturally. Step 2: Instead of replacing "-A" with a blank, replace "-A!@#$%^&" with a blank. In this way, only [what used to be] CR/LF attached to unwanted text will be eliminated, along with the unwanted text. Step 3: Replace all remaining "!@#$%^&" with CR/LF.
  11. Neat solution. I wonder if other browsers have such an extension available. You could also try this -- I do it with a number of web sites. Might be handy for a browser that DOESN'T have a similar extension. 1) Activate the macro based on window title. 2) In the macro, Alt-d to highlight the URL. 3) Copy URL to clipboard, then examine it to see if it's the one you want. 4) Fill in the screen, or exit the macro, as appropriate.
  12. Windows 7, Macro Express 3: This code resizes to the smaller size and centers. Then when I press ENTER to get rid of the text box, it expands the width to only slightly more than my actual resolution. When I grab the top margin and try to move the window, Windows immediately snaps it back to a "reasonable" size that fits my screen. So to answer your question, no, I can't get it to resize the way you suggest. When I tried an excessive height rather than excessive width, again its height was slightly more than my actual resolution. However, in that case I couldn't access the top margin of the window at all, and had trouble getting rid of the window. Window Resize: Current Win - (Width: 600, Height: 500) Window Reposition: Center - Current Win Text Box Display: xxxxxxxxxxxx Window Resize: Current Win - (Width: 4400, Height: 500) Window Reposition: Center - Current Win
  13. I have a similar macro, but it does only a single mouse move instead of two. That is, calculate the intended mouse destination BEFORE moving. I wonder if moving to the extreme limit of the window, rather than safely within the limits, might sometimes be a problem. // .... click on X at upper right of window Variable Set Integer %N30% from Width of Window Variable Modify Integer: %N30% = %N30% - 14 Mouse Move Window %N30%, 9 Mouse Left Button Click
  14. I do something similar for my credit card number, so when I am online-ordering something I don't have to go get the card and look it up. I have refrained from putting the macro on my wife's computer.
  15. One frustration – not really the fault of ME – is the unpredictable time it takes for a copy-to-clipboard command to finish. The ME solution is to set a clipboard delay in “Preferences”, presumably allowing the command to finish. A short delay – even a long delay – always winds up being too short in rare instances; and a long delay wastes a lot of user time. My most useful macro, below, is called by other macros wherever an inline Clipboard Copy would otherwise be used. In ME “Preferences” the clipboard delay is specified as zero. The macro finishes almost instantaneously when the clipboard copy is fast; and waits patiently for over a second when the clipboard copy is slow. My concern when writing the macro was, that Windows would return a non-null but still incomplete clipboard value, so the macro would return to caller with only part of the intended data. In practice that has never happened, and I have been using it exclusively for years with never a problem. // // Set clipboard to nulls -- check to make sure it happens Clipboard Empty Repeat Start (Repeat 10000 times) If Clipboard Text Equals "" Repeat Exit Else End If Repeat End // Copy to clipboard (CTRL-c) Clipboard Copy // Loop until clipboard is non-null, that is, copy to clipboard has completed. Since the value // to be copied may in fact BE null, we limit the loop to a nominal 1 second, then quit, leaving it null. // (Due to overhead, the actual loop time will be more like 2 seconds than 1.) Repeat Start (Repeat 100 times) Delay 10 Milliseconds If Clipboard Text Equals "" Else Repeat Exit End If Repeat End // Return to caller Macro Return //
  16. The alternative is to leave your file as is, continue to read it with Text File Process, but put some code after Text File Begin (and before Text File End) to keep count of which record is being handed to the macro and move to [1], [2], [3] and so on as appropriate.
  17. Text File Process places the entire line into a single variable. When Text File Process reads the first record of your file, "foo" will be placed in ProcessedFile[1]. When Text File Process reads the second record of your file, "bar" will be placed in ProcessedFile[1]. When Text File Process reads the third record of your file, "bip" will be placed in ProcessedFile[1]. When Text File Process reads the fourth record of your file, "wam" will be placed in ProcessedFile[1]. Nothing will ever be placed in ProcessedFile [2], [3], or [4]. If your text file was only a single line, AND that single line contained foo,bar,bip,wam AND you used ASCII File Begin instead of Text File Begin, AND you specified the file as ASCII Delimited Text, then I think the variables would be distributed into [1], [2]. [3]. and [4] as you wish.
  18. Here’s a method that could work: 1) In your primary macro, each time through the loop, write the value you want to display to an environment variable, or a text file, or a registry key, as you choose. 2) In your primary macro, start a secondary macro that runs concurrent with the primary. 3) The secondary macro will consist entirely of a Repeat loop with a one second delay inside the loop, or half-second, or multi-second, whatever makes you happy. Each time through the loop, this secondary macro a. retrieves the value stored by the primary, b. displays the value in a text box, c. waits for the delay time, d. closes the text box, and e. continues to repeat indefinitely. 4) As the secondary macro loops, there will be a very short time – almost imperceptible – that the text box is closed and therefore not visible. Each redisplay of the text box will contain the value most recently stored by the primary macro. 5) When the primary macro wants the secondary (text box) macro to stop displaying, it can store a special value like 9999999. When the secondary finds that special value, it can exit from the Repeat loop and do a Macro Return.
  19. Thanks for the link, Cory. Epic Games founder Tim Sweeney criticized UWP for being a walled garden … "the most aggressive move Microsoft has ever made" in attempting to transform PCs into a closed platform … I’m going to put that jar back on my desk, soliciting contributions for my Send Bill Gates to Jail Fund. Since Win 7, I feel Windows has become harder and harder to work with unless you follow the approved Microsoft path – too much dumbing down and loss of user control. If I didn’t have such an investment in ME macros, I’d sure enough be looking at going to Linux instead of to Win 10.
  20. Have you considered simply staying with an older version of ME that does what you want? Why convert to ME6?
  21. See the screen image below. The yellow arrow points to how you can do an F10 key within the Text Type command, and sure enough, it inserts <F10> like you did through the text file. The explicit command is how I have always done it. It's interesting that you can do it through file input as well.
  22. Yes. What acantor said. You said you don't want the macro to activate, but I suspect you really mean that you don't want it to do the Text Box Display if there is nothing to display. If it simply activates and runs for a fraction of a second, and ends without displaying anything, that should be satisfactory.
  23. How would you choose the option if you had only the keyboard to work with, and no mouse? If the menu is a dropdown list, and if it is organized alphabetically, then usually you can position on the head of the list and just type as much of the entry text as you need, followed by the ENTER key to select it. Your macro can do the typing. If it's NOT that kind of list, then that won't work. Need more information about your specific situation ....
  24. Thanks for the feedback. Glad you have been successful. I used to work for a hospital, too. We used the Eclipsys SCM system. Sometimes I would have to apply identical maintenance to dozens or even hundreds of database entries. We weren't permitted to do direct table maintenance via SQL, so we had to use the application maintenance screens, and macros saved me HUGE amounts of time clicking through screens and typing. It takes some effort to set up the macros, but often much of the code is reusable for similar functions.
  25. First off, get rid of the MACRO STOP which is the second-to-last line of the macro. The macro will stop when the ASCII FILE processing loop is done, without your telling it to stop. The loop that is repeated in your macro begins with ASCII FILE BEGIN PROCESS and ends with ASCII FILE END PROCESS. Each time through the loop, only a SINGLE LINE from the file is made available in the %T% set of variables. So you should do all the initial typing, including the ARROW UP and F10 to remove the system-inserted data. THEN you can have the sequence ASCII FILE BEGIN TYPE T[3] (stuff) TYPE <ENTER> ASCII FILE END That loop will feed you all the T[3] entries one after another and type them. Actually, since some of the third column entries are empty, this might work better: ASCII FILE BEGIN IF T[3] NOT EQUAL “” TYPE T[3] (stuff) TYPE <ENTER> END IF ASCII FILE END Once all of the third column is typed, position on the screen and repeat the entire loop to type in the fourth column: ASCII FILE BEGIN IF T[4] NOT EQUAL “” TYPE T[4] TYPE <ENTER> END IF ASCII FILE END I don’t think anything prevents your repeating the ASCII FILE BEGIN through ASCII FILE END as often as you want in the macro. Each time it will process the whole file from beginning to end, and you can pick off whatever column(s) you want during each pass. For example, since columns 1 and 2 are only in the first line of the file, you could have a separate BEGIN through END just to pick up that line and type those two columns. (I think there is an option with ASCII FILE BEGIN to process only a single line, so you wouldn’t have to read through and ignore all the other lines just to get line 1.) So one ASCII BEGIN / END loop to handle the two columns of the first line. A second BEGIN/END loop to handle as many third column entries as there are. A third BEGIN/END loop to handle as many fourth column entries as there are. Good luck!
×
×
  • Create New...