Jump to content
Macro Express Forums


Popular Content

Showing content with the highest reputation since 04/05/2019 in all areas

  1. 1 point
    There is nothing inherently risky about saving data in the registry as long as you know and remember which registry area (key) you use. Using the registry may be somewhat faster than reading from a file. However, depending on what your macro is doing, you may not notice the difference. There is a potential side effect of using values in the area of the registry (registry key) that Macro Express uses such as this: HKEY_CURRENT_USER\Software\Insight Software Solutions\Macro Express 6\My Values When you export the Macro Express settings (Tools, Export Program Configuration) and then import them either later (Tools, Import Program Configuration) Macro Express will display a warning about the registry keys and values that it does not recognize. It is pretty safe to use other areas of the registry such as HKEY_CURRENT_USER\Terry Work Area You could also use something like this: HKEY_CURRENT_USER\Software\Insight Software Solutions\Macro Express Data
  2. 1 point
    Yes, me too. I chose a similar location, with separate keys for Integer and Text, and made it a 'Favorite' for fast access.
  3. 1 point
  4. 1 point
    I'm not sure what you're trying to do but you can look at all the activation methods in the help file. If someone types a series of letters or numbers you can make that activate a macro. You can use a VBA macro to launch the MEP macro. Again look in the help file under Command Line Parameters. You can use the MeProc.exe with parameters that will launch a macro.
  5. 1 point
    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) //
  6. 1 point
    Generally, in Windows, this appears as CRLF, not LFCR. Try this: Variable Modify String: Replace "-A%CR%%LF%" in %Temp% with ""
  7. 1 point
    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.
  8. 1 point
    2D 41 0D 0A 2D 42 0D 0A 2D 43 0D 0A 2D 44 0D 0A 2D 45 THis is how your text actually looks like to the computer internally. Each of those pairs is a hexadecimal representation of the binary. Each represents a byte, 8 bits, of data. By applying the ASCII encoding, you will get the letters and such that you are used to seeing. Click here to see a table of the value, E.G. 2D is a hyphen, 41 is "A". I think it helps people if they can see what it's happening behind the scenes. And in binary. How it actually is in memory or on disk. Cut those into chunks of 8 and you can manually decode them yourself. If you're really bored 🙂 0010110101000001000010100010110101000010000010100010110101000011000010100010110101000100000010100010110101000101
  9. 1 point
    When you do the replace, include a newline set. A newline in Window is two non-printing characters carriage return and line feed. 0x0d and 0x0a. That's what gives you the line break. Click here for my instruction on how to create them in MEP. You will want to add them to the end of the string you want to replace.
  10. 1 point
    @rberg: For Firefox and its derivatives like Waterfox there's Add URL to Window Title (Advanced KeePass Usage) https://addons.mozilla.org/en-US/firefox/addon/add-url-to-window-title/ @Service Center: There's also the direct option of triggering the entire activity by running a macro instead of a bookmark. It would open the page and then do your work on it. A pop-up menu containing all such 'web work' macros would be a convenient access method. Or, if there are only a few, memorable hotkeys. Alan: Me too; many nerdy hours of pixel and text forensics!
  11. 1 point
    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.
  12. 1 point
    What I just came up with is using a Google Chrome extension ("Add URL To Window Title") that adds the url to the Window Title in chrome (I also limited it to the specific webpage in the Extensions Details) and then used the Macro Express Window Title activator and that seems to be working well.
  13. 1 point
    Alan, I got same behaviour on the couple of tests I had time for (Firefox and a folder). Strange. Speculative, but may be related to the other mouse cursor issue we were discussing? -------------------- EDIT at 08:40 Scrub that speculation! It's because the macro logic is wrong! The following does the job: Variable Set Integer %x%: Set to the Current Window's Width Mouse Move: %x%, 0 Relative to Current Window Mouse Move: -10, 10 Relative to Last Position // Nudge the mouse pointer a little so that it is visible in maximized windows <VARIABLE SET INTEGER Option="\x0A" Destination="%x%"/> <MOUSE MOVE Option="\x02" X="%x%" Y="0" _PROMPT="0x000A"/> <MOUSE MOVE Option="\x03" X="-10" Y="10" _PROMPT="0x000A" _COMMENT="Nudge the mouse pointer a little so that it is visible in maximized windows"/>
  14. 1 point
    Are you sure you don't mean Alt-Enter?
  15. 1 point
    Hard to advise without seeing an example macro. For instance, are you activating it when a window is opened with that title? Or when it gains focus as @acantor assumes? And must it be an exact title or a partial one? What operations is it performing after starting? If for instance it's using a Text Box Display (TBD) to give you a message then as soon as you close that TBD it will probably regain focus and start the macro again. However, I've found that MEP sometimes does not respond reliably to window title commands. Timing or other obscure conflicts with the OS may be the cause. In which case other 'recognition' methods may be needed. Could you share a very simple macro that consistently exhibits 'activating over and over'? (Ask if you don't know how to do that.)
  16. 1 point
    Try changing the activation from "Window Gains Focus" to "Window is Opened." That change will hopefully cause the macro to activate only when the window first opens, rather than every time the window receives focus.
  17. 1 point
    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. 1 point
    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. 1 point
    That's a difficult one! No single macro would warrant the title of 'my best' and if I compiled a short list of 'most useful' from the couple of thousand I've written it would cover a wide spectrum. Used up to scores of times a day - Sizing and positioning windows (mainly File Explorer folder) - Opening frequently used folders - Typing frequently used text with shortkeys (file and folder paths, signatures, email addresses, my name and address, phone numbers, regular phrases like 'Best wishes', etc) - Typing date & time with shortkey '=dt' Wednesday 7 August 2019, 1402 - When saving a series of files (such as when browsing images or text etc that I need for videos), a click close to the right of 'Save As...' (or variations) saves it as xyz-05 if the previous was xyz-04 - In all my applications, middle clicking its title to display a menu of macros, sometimes via subfolders - When creating a Text Box Display command, generate 'VariableName = ' to the left of '%VariableName%' with a single click -Etc Infrequently used but invaluable - During my frequent work in Google Earth, Google Maps, Memory-Map, etc: finding/copying/moving places and tracks between them; changing properties of multiple tracks, etc - On average once or twice a week, but many more directly after a walking holiday: from the GPX file of a walk recorded on my iPhone, automatically creating an Excel spreadsheet like that I showed in the recent thread about VBA, plus a profile like this: https://www.dropbox.com/s/63dwbplk410mj80/20190709Falmouth-Portscatho-r483-m6.7-PS.jpg?raw=1 (That's one of my most complex macros, calling a dozen submacros, some of which use VBA and some use Python scripts I've written in PaintShop Pro. I'd say it's probably the one I'm most proud of.) - One of Cory's, with only minor adaptation by me: 'Search and report on macro text'. - Etc -------------------- I'd like to have used the 'Last run time' column to give a more objective reply on the first category, but (a) It doesn't include submacros (b) It gets destroyed when a new version is installed
  20. 1 point
    I have written some very complex and powerful macros. A hospital back east had banks of computers running a macro I wrote around the clock for years. But the two that I have gotten the most use out of are simple. The first one simply types a date stamp. I use it in file names, notes on task, and dozens of other places. I'm amused at how often that's useful The second is a task tracking number. I type "TTN..." and it looks up the last number, increments it, and types out something like "TTN4521". I create tasks in Outlook with this in the subject, tag emails, time logs, task folders, and many other things. Later it's easy to find all relevant correspondence, file, whatever. And I have another "TTNR" which re-types the last number. Funny that I've written so many complex and powerful macros, and yet this is what I use most. Of course when professionally developing macros, one doesn't use those oneself. On a related note, I don't write as many macros as I did. I have been programming now for years and when it comes to automating most things, a proper program is better. Like web scraping. MEP is just not suited for that kind of stuff. But what MEP is great at is things like this. The little macros that save seconds a hundred times a day. Also things that are semi-automatic. Like a macro to file a PDF file from a scan where the user has to answer some questions and the macro blasts though all the menus and dialogs. One just can't beat it for things like that.
  21. 1 point
    To run any macro posted to you in the form that I did, you you can either: 1. Type the commands into a new macro of your own, but changing anything that needs it. In this case you don’t have a folder called "c:\users\Terry\Test" so create one of your own and enter that instead. 2. Copy the code and paste it into a new macro, then make the same change.
  22. 1 point
    One thing to try: From the list of macros in the macro explorer, right-click on it and choose 'copy.' You'll have to give it a new name and trigger, but the code will all be the same.
  23. 1 point
    Your approach gave me an idea of another way to handle the input data, but without using the clipboard. Create a plain text file that consists of one line. I used Notebook to create the file. I inserted a string of 600,000 characters on one line. (PS: I typed 10 characters, selected everything and copied, and pasted ten times. Then I repeated the process until there are 1000 characters, then 10,000, then 100,000. It takes but a minute to generate hundreds of thousands, or millions, of characters.) Then the script uses "Text File Begin Process." I specified the variable to receive the information, and chose "Process All Records" beginning on record 1. It takes time to save the file, but once it has been saved, the macro runs almost instantly (at least on my computer). Text File Begin Process: C:\Users\Me\Documents\tmptmp.txt Text File End Process Variable Set Integer %y% to the length of variable %x% Text Box Display: %y% Variable Set Integer %Digit% to 0 Repeat Until %Digit% Is Greater Than "9" If Variable %x% Contains "%Digit%" Text Box Display: YES, contains at least one digit Macro Stop Else Variable Modify Integer %Digit%: Increment End If End Repeat Text Box Display: NO, does not contain any digits
  24. 1 point
    My processor is Intel Core i3-2370M CPU @ 2.40GHz 2.40GHz. I don't know what that means. Here's the ME routine I tested with. I built a Notepad document so I could easily modify the number of characters for tests. The first couple lines, copying to clipboard, took no more than a second or so, even with 500,000 characters. Setting string T1 from the clipboard took many seconds, maybe 15 or 20 seconds, with 500,000 characters. Very fast with only 5,000 characters. Displaying the "release" text box allows estimating the actual scan time (your code) -- that is, from the time I hit ENTER to close the "release" box, until either the "contains" or "contains none" box appears. So, to finally answer your question, your code runs almost instantaneously whether I start with 5,000 characters or with 500,000. I used Macro Return rather than Macro Stop like you did, but I doubt that matters much. // Text Type: <CTRLD>a<CTRLU> Macro Run: 0_Generic_Copy_To_Clipboard Variable Set String %T1% from Clipboard Text Type: <END> Text Box Display: release to start process Variable Set Integer %N1% to 0 Repeat Until %N1% > 9 If Variable %T1% contains "%N1%" Text Box Display: contains Macro Return Else Variable Modify Integer: Inc (%N1%) End If Repeat End Text Box Display: contains no digits Macro Return //
  25. 1 point
    There are thousands of hotkeys. For example, there are about 750 hotkey assignments in Microsoft Word alone. So if you're into the macro scripting game, you will, in time, face situations where you find yourself "expropriating" built-in hotkeys. Most of the time, my philosophy can be summed up as, "built-in hotkeys be damned!" If there is a task that I need to automate via macros, and the hotkey I have in mind is consistent with other hotkeys, if it's memorable, if it's logical, and if the user has no use for the built-in hotkey and/or isn't aware it exists, then that's the key assignment I'm going to favour.
  • Create New...