Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. I don't think so. I've done it before. I think you're underestimating. 😁 Or maybe I'm just an inefficient MEP code writer. I've also done SSN, Dollar amounts, and more. Even using RegEx after a few million pages I often find the RegEx I created was deficient in some obscure way and I would end up spending time studying the RFCs and learning a lot about the valid format. For your over-simplified example, I could probably do it in 60 lines, but looking at it for only a few moments I can think of a few examples now in your set of examples that would cause it to get much more complicated. It's always 3 times more complicated that I initially think. And even if it's only 60 lines, that's a lot more than one line of the RegEx.Matches method. One thing I fail to concede is that using RegEx is super easy... If you know RegEx. And that's no mean feat to learn. But I will say once one does take the, the applications are numerous and one doesn't have to create the engine every time, one just needs to figure out the best pattern. BTW one wants to use a RegEx developer. I use RegEx Buddy but there are excellent online developers. Also most of the common expressions have been thought out already and available to use. I was thinking of an odd email address I found once that was _@domain.com so I searched and found a list a RegEx developer compiled of valid and invalid email addresses to help you test. You can iterate through these to gauge the effectiveness of your code. Probably some better test lists out there. Many "oh yeah.... Hadn't thought of that] ones I see in there like firstname+lastname@example.com or email@[123.123.123.123]. And invalids that would be interesting to avoid like email@example@example.com. Are you avoiding double periods? Length limits? And of course if your project can tolerate a small error rate, then no need to complicate your code for these examples. But this is like some of the stuff I ran into. Also it depends on your data source. I often was tasked with scraping random and indeterminable sources. If you're working within a company say that has rules about email formatting then your task will be much simpler. I do applaud you pushing the limits. I have written so many sub-macros like this over the years like array bubble sorts and much more that MEP. It's a good exercise I just change my philosophy and I'm not interested in spending the long hours doing that. I'd rather bill hours and get more practical things done with me life. And I have a lot to get done if I'm ever going to get out of this state. You're good to avoid spaghetti. I would often have to come back and work on a macro years after I wrote it and it would take me a long time to figure out my methodology. So unless it was doing heavy processing, it was better to use more varails than absolutely necessary, more comments, more modularity. Sure it might be twice as long, but it's more important to be able to work on it easily in the future. If it's a non-iterative macro for a user who only uses it 100 times a day, then let it be understandable at the cost of a millisecond. When I started in .NET one can nest functions inline. So instead of defining a single use variable and executing a method to save in that variable and then use it in a later function, one can just place that first function as a parameter of the second function or method avoiding the creation of the variable. I got really excited because I could write code in much fewer lines. Yup. I forgot my lesson. Coming back later it was much harder to understand. But the cool thing with .Net is you get to have your cake and eat it too. In MEP if I expand my code to be readable, it takes longer. In .NET the MSIL (it uses an intermediate language and 'just in time' compiling) compiler is so smart it rearranges my code into the super effieinct version. I'll make a new post for my app later. I might send it to you in PM to get your feedback for instructions. I'm burning daylight (Ranch/farm speak for "I need to get back to work").
  2. "Your script shouldn't use RegEx" LMAO. Well OK. So let's build a house with a hammer and handsaw when we have free access to an entire trailer of construction tools. I gave up writing scrapers in MEP because of its limitations. There's no point in reinventing the wheel. I wrote many macros to do things like this and then I would learn about some rule I wasn't aware of, some odd case. Or even how one establishes word boundaries. Could be a space, could be a comma or other punctuation, beginning or end of line, a tab... That alone is like 100 lines of code and don't even get me started on valid characters, subdomains... It's huge. In RegEx a word boundary is "\b". Done. In the 70's some smart guys got together and realized they were often needing to process text like this and invented RegEx. Innumerable man hours have been added since then improving it. And it's free. I'd rather use an external script with one like of code for the RegEx so I'll decline the challenge 🙂 Aside: I created a program that MEP could use to do Regex without external script. It could be visible or invisible and manipulated by Windows Control commands. Worked great There was zero interest here in the forum. Good luck reinventing RegEx. Just kidding (only a little)
  3. It sounds like you're entering this into a form. Maybe a Db. One form per row. Looks like F12 saves the record. Is this like what you are using? First off I'd use controls if you can. If it's a web page you can't. Elminates all the problems with text typing and clipboard. About 100 times faster and much less prone to errors. No timing needed. I second what rberq said about clipboard and timing.
  4. You might consider writing two posts when you have 2 unrelated questions in the future. 1- Why don't you type "10 20" in the prompt as string and split it on the space? 2- The only time you should need a delay is when the program you're working with takes time to respond. I don't use delays like that. Maybe you could create a dem macro using Notepad for us. Also if you use controls or other such things to control timing you will not waste time performing the maximum delay each time. It's rare I ever have a delay like that. Even if there are no controls I can use, I'll check a pixel color or something.
  5. Interesting. Seems a bit dubious to me. Maybe two of them are pretending to be something they're not for nefarious reasons. I'd stick with something more mainstream and well vetted. Good luck.
  6. Why do you think there's more than one version of Notepadex?
  7. Late to this. I've never had a need to enable and disable macros. Typically scope and other things will suffice. I've often wondered why people would use it. I have had some things like this for a few clients. But instead of disabling, I'd add logic to the start of a macro. It would either check for the condition, that you are using in your brain, and decide to continue or not. Or I would control it with a Boolean registry setting.
  8. Notepad has been changing also. Mostly in Windows 10. You might check that you have the most recent version before dismissing. I know for sure that the Windows 7 version is different that the 10. I remember we had one thing that occured here and that is it switched from being only ASCII/ANSI to supporting many encoding types. And, by default, it now uses UTF-8. Which MEP users need to be aware of because even if a file only contains ACSII, it will still have a BOM at the beginning. Also I don't see much about Notepadex. It seems that most opt for Notepad++.
  9. I don't have any good ideas. The only one I can think of is if Notepadex is UWP. Some people here have had luck with UWP apps but it's rare I get anything like a hotkey sequence to work in them. Maybe the key combination is already reserved in Notepadex. I looked online and several word processors like Word and WordPad use it. Temporarily try a radically different combination. Also what happens when MEP is disabled and you type that combination in to Notepadex? Sorry I don't have any great ideas for you.
  10. ISS = Insight Software Solutions is the maker of MEP. https://www.macros.com/supportrequest/ If you have all the settings correct in MEP you should only need the one line. Since you have tried multiple SMTP servers it sounds like something besides MEP is causing it not to send.
  11. I don't know. You should start a trouble ticket with ISS.
  12. Do you have security software that's blocking MEP? What error are you getting?
  13. The same. You configure MEP with the the SMTP server parameters and use the simple Email Send command. Host, port, credentials. email address and display name. That's it. Preferences > Email > SMTP Settings.
  14. In the Chrome Help you can find the keyboard shortcuts. For Incognito it's Ctrl + Shift + n. My first thing I do when writing macros for an application is to find a reference for all the keyboard shortcuts. Then you can also use the shortcuts in Gmail.
  15. The Email Send command is much simpler. It's the top one under the Internet group.
  16. I have no idea what that means. https://sendpulse.com/ I just thought of something else. I had problems with some equipment no working with an SMTP server. I signed up for a free account from these guys and it worked great. Provided you're not sending a huge number of emails, this works well. There are many others like this as well.
  17. https://support.google.com/a/answer/176600?hl=en Should be like this.
  18. 25 is non encrypted. Gmail will not accept that. 465 is for SSL, the older protocol, and 587 is TLS which I'm guessing is what they want.
  19. It's easy and straightforward. I've only used the mail servers from my Office other accounts accounts, but it's the same for all SMTP. Find your settings at the Google help site and configure the mail server connections in Preferences.
  20. You could also terminate the macro from the "Forrest Gump" icon in the System Notification Area. No macro required. And you can make it so Forrest is always apparent when a macro is running.
  21. I used to write distributed MEX files with many users and it was almost like a program. Having that registry worked well and had fewer problems that file based solutions. Also I could edit the registry remotely. But the window title trick is nice too. Most times the interrupting macro needs some kind of interface, so just use that. XYZ sees a window title "Macro ABC" pauses, then pops up a box asking if the user wishes to terminate or continue. Say ABC does some little thing quickly for the user and then wants XYZ to continue. Click that button and it does without having to restart the macro.
  22. I use the registry. For my big macros I usually set up a key for my macro stuff including controls. Another way I have done it is to have the first macro checks for the existence of a window title or control. The control or text would be the message box displayed by the second macro.
  23. Oh of course. Sorry. I never have this need because as I and rberg suggested I always have the first macro terminate itself at the request of the second macro.
  24. Why wouldn't you use the Macro Stop command? Also I prefer to put something in XYZ that would watch for a command to terminate. YO udon't want to terminate the MEP process becasue that woudl terminate MEP that's also trying to run ABC
×
×
  • Create New...