Jump to content
Macro Express Forums

rberq

Members
  • Content Count

    820
  • Joined

  • Last visited

  • Days Won

    35

rberq last won the day on February 24

rberq had the most liked content!

Community Reputation

19 Good

About rberq

  • Rank
    Master

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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.
  2. 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.🙂
  3. 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.
  4. 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
  5. 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.
  6. 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 //
  7. 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. 🙂
  8. 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) //
  9. 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.
  10. 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.
  11. 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
  12. 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
  13. 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.
  14. 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 //
  15. 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.
×
×
  • Create New...