Jump to content
Macro Express Forums

terrypin

Members
  • Posts

    2,230
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by terrypin

  1. I'm reluctantly giving up on my method for an MXPro only solution; life's too short! Alan: Am I right that your current solution is for a single line of text? I've been assuming multiple lines; essentially a file of text.
  2. I ran that Regex in my text editor, TextPad, on many files varying in size, number of lines, words and successive spaces. Most were almost immediate in response. Number of lines seemed dominant factor. But note also that I added spaces to only a single line in each file, although some of them also already had longish sequences of spaces. Here are four example results: #1 7 KB, 15 lines, 6.7K chars, most spaces 6.4K = Under 1 s #2 289 KB, 60 lines, 289K chars, most spaces 6.4K = Under 1 s #3 111 KB, 282 lines, 15K chars, most spaces 101K = Under 1 s #4 471 KB, 11K lines, 443K chars, most spaces 101K = 5 s Those timings would obviously increase if I used a macro to apply the Replace command. Haven't quite given up on my 'MXPro only' method, but close to doing so! EDIT: Someone I contacted with real regex skill pointed out a much simpler setting: Find: _+ Replace with:_ (where '_' is a space.)
  3. "5. If there is an elegant RegEx solution, the contributors of this forum who know how to implement it have been silent (so far!)" I'd assumed it had to be done entirely in MXPro? I'm off to bed shortly in the hope that I'll dream up the bit of my approach that's evading me. But if a paste into my text editor is not breaking the rules I'll see if Regex can solve it. EDIT: OK, it came to me a few minutes later. This Regex should do it Find ([^ ])([ ]+) and replace with \1 (That's \1 plus a space.) In english: Find string #1 that is 'not a space', followed by string #2 that is 'one or more spaces', and replace it with string #1 followed by one space. But the purist in me still wants it done in-house. 😉 Tomorrow...
  4. @rberq Yep, I'm struggling too! Motivated by your midnight post (and rain cutting short my garden chores) I've just spent a frustrating hour, but no joy yet.
  5. Too much else on my plate to spend serious time on it. But I’m wondering about another approach: replace all spaces with CRLF, then use one of the text processing loops to add a single space to the resultant ‘lines’.
  6. “And how do I remove scopes?“ Set the scope to Global. If this is one of your first macros I recommend you invest some time getting familiar with the very basic stuff.
  7. Thanks for checking Cory. With that option disabled it seemed to slow down macro text typing significantly, so I re-enabled it. Have not yet re-tried the problematic macros, but I suspect the issue might be related to the application to which they are scoped, Paint Shop Pro, not MXPro. If so, it's OT, but in case anyone is curious... Today I went to my Win 10 taskbar to open PSP8 and found two thumbnails available instead of just the usual one. Task Mgr confirmed two instances of Paint Shop Pro.exe. I opened one from the taskbar then clicked away and went back to try the second - but its thumbnail had vanished. Yet both still existed in TM. I then closed PSP 8 in the normal way - but both instances are still present in TM!
  8. I've always had the option shown enabled. But today various normally reliable macros failed and after hours of trouble-shooting (which naturally included increasing delays), I found that disabling this resolved the problem. First time I believe I've ever had to do that. Anyone else with similar issue or ideas on possible explanation? This is Win 10, Version 1909 (OS Build 18363.836) and MXPro 6.1.3.1, and CPU usage during running attempts was never significant.
  9. Yes, as I said. Quicker to try it than to ask! You can’t break anything.
  10. Try entering the Tab in plain form straight into the Direct Editor, i.e. as <TAB>, no Text Type command.
  11. Following on from Cory’s suggestions, if the problem you describe does occur after editing your macro to apply in Notepad, post it here in a Code box so that we can try it. Include the command text and the code.
  12. That’s what I call tenacity, well done Alan! Re the remaining problem, is the digit zero actually used in the Canadian post codes?
  13. I was referring to the three line macro you displayed in your opening post. At the end of that. Please provide details, including the macro code and a screenshot clarifying what you mean by that mention about variables. We're looking for some distinction between the result of your opening 3-line macro (perhaps with the respective additions I've suggested) versus the status after opening Casper manually. You seem to be confirming that an extra step is taken by the latter but not the former. It's straightforward enough. A simple example would be to use Notepad. (At C:\Windows\System32\notepad.exe or C:\Windows\notepad.exe). After the Enter command, has the macro launched Notepad and then started a new line? That should at least confirm that your macro has no obvious error. It's not normally visibly evident that a program is running in elevated mode. Use Task Manager, select the Details tab, ensure the Elevated column is enabled, and check. Or, to repeat, just run in it elevated mode; you can't break anything!
  14. Is the program definitely active when the macro ends? Try adding a Window Activate before the Enter. What is the longest delay you tried instead of 1s? Try a 0.1s after the Enter. Are you sure another operation is not needed before the Enter? Possibly a selection that Casper normally performs by default? Leaving the macro (or its experimental variations) unchanged, replace Casper.exe with another program that you know always responds to Enter directly after launch. Confirm that it works. Try a second Enter. You didn’t answer Samrae’s question, so we and you are still unsure whether Casper runs elevated. Try his suggestion anyway, just to eliminate that as a cause. ———— See the recent thread about email notifications. Bottom line: check back frequently.
  15. Is 1 second long enough to allow a complex app like CASPER to open and stabilise? Try adding a Wait for Window Title.
  16. As for my intended approach, getting the 7-character groups into an array proved easy enough. But my assumption that the subsequent manipulation of these would be easy was over optimistic! Your solution, Alan, incorporating @rberg’s substitution logic looks great to me, well done, and thanks for an interesting thread. (Trivial point: it seems you switched to using A instead of L for alphabetic characters, so your introductory comment needs editing.) But wish I had learnt VBS 😉
  17. @rberg: Neat! Could you post the code so I can explore it further please, as I haven't grasped how it handles an address containing special chars.
  18. Hi Alan, I'm sorely tempted, but that would mean raising the task several places up my To Do list! Another excuse is that because MXPro sadly lacks Regular Expression features I would always tackle this sort of requirement with assistance from another application, usually my text editor, TextPad. Your challenge is akin to asking me to attach a screw without using a screwdriver. And yet another reason is that I expect you already have a brilliant solution 😉 But if curiosity does get the better of me, then I think I might start as follows: // @acantor's challenge to extract a single post code from a line of text. // No external applications are allowed. // Assumption: a reasonable max length of a single address line like the examples provided is 100 characters. Variable Set String %tResult% to "" // Just in case. Variable Set String %tInput%: Prompt // (Disabled for testing) Variable Set String %tInput% to "1234 Chaplin Dr. Twr. 1- 6th floor , Mississauga, ON L4Q 5Z3 Canada" Variable Set Integer %nLength% to the length of variable %tInput% // A line of that length contains (nLength-6) groups of 7 characters. // So my first approach will be to test every group until I find one with the post code format LDL DLD. // The parsing of that should then be straightforward. Terry
  19. Yes, I’ve always had to write my own ‘wait until ready’ code for Firefox and later Waterfox. That failed occasionally and I no longer bother, usually inserting long delays before I attempt manipulation. A command that will work for those and Chrome, Opera, Edge (Microsoft’s replacement for IE) would be handy. I would prefer to see extra web-work functionality within MXPro. But I’m not into web stuff much these days so probably not a typical prospect.
  20. Hi Joe, pleased to hear from you after such a long time. I’m no programmer, but yes I would indeed like to see MXPro offer improved power and flexibility for web stuff, if that’s what you’re asking. A start would be to get a reliable command that would detect when a site is in a ready state to accept further commands. For any browser. Still occasionally dipping into your excellent book - but how about an update for MXPro under Win 10? 🙂 Terry, UK
  21. OK, pleased to see you appear to have now got the hang of it 😉 BTW, I never had an answer my question about the macro I exported? That would have avoided your difficulty with understanding what to paste. (Although it would admittedly have required learning how to import!)
  22. Invest a little time learning some basics, both about ME Pro and using this forum. In particular, learn how to quote messages. With text, using the Quote tool, not screenshots. I’ve no idea what your latest post is meant to show us. Perhaps others with more patience will step in, but as they say on ‘Dragons Den’, I’m out!
  23. I recommend you use ME Pro’s excellent Help to understand this sort of very basic stuff. Here’s an extract: Copy Command Text - (Script Editor Only) Highlight one or more lines of the macro script. Then click on Edit | Copy Command Text. This option copies the lines of script to the Windows clipboard. Paste the script into another application and the contents are displayed shown in the Script Editor. Typically the contents display in a macro format similar to the Direct Editor script when copying the script to the clipboard and pasting. Use the Copy Command Text function to display the contents exactly as they are shown in the Script Editor. Did you also try to import and run the macro?
  24. That’s easy enough: copy the code section (not the command text), open a new empty macro, and paste it in. Or you can just import the finished macro I exported and attached for you, and run that directly.
×
×
  • Create New...