Jump to content
Macro Express Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by rberq

  1. Did you see this line where you can set the notification options? Settings shown get me an email for each reply to a topic I follow.
  2. This solution builds the LDL DLD pattern by substituting characters: Any letter becomes @ Any number becomes # Any space becomes $ Then it searches for the pattern @#@$#@# within the substituted text, and extracts the corresponding positions from the original text. The solution is a little crude because it doesn't allow for multiple pattern matches within the address -- probably I would add code to take the last match in that case. Joe's solution using VBSCRIPT is certainly more elegant, but kind of breaks the ME-only rule.😧 // // Extract Canadian postal code Variable Set String %T1% "1234 Chaplin Dr. Twr. 1- 6th floor , Mississauga, ON L4Q 5Z3 Canada" Variable Set String %T1% "25 Clark Street, 1st Floor, Toronto, ON, M8C 1X9, Canada" Variable Set String %T1% "111 rue de Chaplain, Montreal PQ H2P 7W9" Variable Set String %T1% "J2E 6G2 (main entrance)" // Move address to working variable T2, clear destination variable T3 Variable Set String %T3% "" Variable Modify String: Copy %T1% to %T2% Variable Modify String: Trim %T2% // Get rid of any special characters @, #, and $ that may already exist Replace "@" with "" in %T2% Replace "#" with "" in %T2% Replace "$" with "" in %T2% Text Box Display: Debug special characters removed // Replace letters with @, numbers with #, blank spaces with $, building result in T3 Variable Set Integer %N1% to 0 Variable Set Integer %N2% from Length of Variable %T2% Repeat Start (Repeat %N2% times) Variable Modify Integer: Inc (%N1%) Variable Modify String: Copy Part of %T2% to %T9% If Variable %T9% >= "A" AND If Variable %T9% <= "Z" Variable Set String %T9% "@" End If If Variable %T9% >= "a" AND If Variable %T9% <= "z" Variable Set String %T9% "@" End If If Variable %T9% >= "0" AND If Variable %T9% <= "9" Variable Set String %T9% "#" End If If Variable %T9% = " " Variable Set String %T9% "$" End If Variable Modify String: Append %T9% to %T3% Repeat End Text Box Display: Debug letters/numbers replaced with special characters // Postal code LDL DLD will have been replaced by @#@$#@#, so find position of that string within the address in variable T3 Variable Set Integer %N9% from Position of Text in Variable %T3% // Extract corresponding characters from original [trimmed] address in T2 Variable Modify String: Copy Part of %T2% to %T12% Text Box Display: Debug original address and extracted postal code // // Macro Return //
  3. The emails appear to come from noreply@invisioncloudcommunity.com
  4. ... For responses, I have had good luck by clicking "Follow" at top-right, and selecting the option to get an email whenever there is activity. Strangely enough, just because you originated a topic, doesn't mean you are automatically enrolled to "follow" it.
  5. ... 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? 😉
  6. .. 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.
  7. 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.
  8. 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?
  9. 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.
  10. 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.🙂
  11. 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.
  12. 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
  13. 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.
  14. 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 //
  15. 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. 🙂
  16. 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) //
  17. 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.
  18. 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.
  19. 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
  20. 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
  21. 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.
  22. 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 //
  23. 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.
  24. 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.
  25. 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.
  • Create New...