Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,203
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by rberq

  1. ... If the older version does what you want, and is simpler to use, then it's perfectly OK to stick with it. After all, I still use the old Macro Express Version 3, and so far it does everything I want. If you have an experienced carpenter with an old hammer, why push him to buy a new one? 😉
  2. .. You were correct to replace the Program Launch with the two commands I suggested. I think you should also get rid of the command that types <CONTROL>n. I tinkered with this a little more, and expanded my macro as follows: Text Type: <WIND><WINU> Text Type: SnippingTool Text Type: <ENTER> Delay 1000 Milliseconds Text Type: <ALTD>n<ALTU><ENTER> Macro Return The first three lines start the snipping tool application. The delay of one second is just to give the application time to start -- you may need a shorter or longer delay. The tool has focus to receive commands when it starts, so the next line typing <ALTD>n<ALTU><ENTER> tells the tool to do a "New" snip, and <ENTER> selects the default Rectangular shape. Beyond that, I can't help much, because I'm not familiar with most Snipping Tool options.
  3. Try using the keyboard sequence to start it. The following works in Windows 7: // Text Type: <WIND><WINU> Text Type: snippingtool<ENTER> // I don't know why your macro doesn't work the way you wrote it. There's something weird about the way Windows indexes to some programs. Even though Windows Explorer shows it as a normal .exe in the System32 library, you can't open it by double-clicking the name. I read the explanation once upon a time but I'm not sure I understood it even then.
  4. 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?
  5. 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.
  6. 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.🙂
  7. 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.
  8. 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
  9. 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.
  10. 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 //
  11. 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. 🙂
  12. 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) //
  13. 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.
  14. 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.
  15. 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
  16. 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
  17. 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.
  18. 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 //
  19. 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.
  20. 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.
  21. 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.
  22. 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.
  23. Have you considered simply staying with an older version of ME that does what you want? Why convert to ME6?
  24. 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.
  25. 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.
×
×
  • Create New...