Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,521
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. Earlier in this thread, I shared my "best" macro of 2022, which holds down the mouse button for five seconds and then releases it. This afternoon I've been experimenting with ChatGPT. It's surprisingly good. Much better than I expected. In a moment of levity, or perhaps of optimism, I asked ChatGPT a question about Macro Express: The AI-generated response is fascinating, although I think ChatGPT may have been hallucinating about how Macro Express works! ChatGPT's database mostly contains information gleaned from the web prior to 2021, so this inaccurate but plausible-sounding answer wasn't pulled from this thread.
  2. On some computers, I have no problem using Macro Express to "expropriate" F1 for my own purposes. On other computers, especially in corporate environments, key combinations that include F1 are not recognized when remapped, e.g., Shift + Alt + F1 and Ctrl + Alt + F1. It's as though certain applications "see" the key combinations before Macro Express does. I'm not sure whether this relates to the version of Macro Express. I have remapped F1 on my up-to-date version of MEP running Windows 10, but I hit walls when using the 18-month old version of MEP that my corporate client uses, also running Windows 10. My guess it's less about the MEP version than about the way my client configures their computers.
  3. I don't see an obvious reason why a hotkey macro won't respond in the "Disk Management" window. Try recreating the macro from scratch, paying extra attention to its scope. Experiment with window specific and application specific, partial / exact matches, and hidden / non-hidden windows. For testing purposes, set the scope to Global. Try totally different hotkeys. I recently stumbled on a bunch of key combos I couldn't assign because a background application "saw" the hotkeys before Macro Express did. (In this case, the affected hotkeys included F1, e.g., Ctrl + Alt + F1.)
  4. Firefox has a search-links-only feature which I've used instead of Ctrl + F to reduce search volume. The feature is helpful in another situation: If a string appears many times on a page, but only once as part of a hypertext link, search-links ensures the script zeros in on the link. The hotkey for search-links in Firefox is the open single quote character. That's a problem. If focus is in an editable field, the hotkey fails; instead the hotkey inserts the single quote character. (Maybe there's a way to change the hotkey to Ctrl + something, which would allow feature to work in more contexts.) Strangely, the feature appears to be absent in Chrome and Edge.
  5. I've built scripts that search for text adjacent to a field I want to focus. Then the script tabs or (Shift+Tab) to the target. In pseudo code.... Type "Control+F" // Find on the page. In some applications, you can use F3. Wait a split second Type "City:" // Unique text near the field I want to get to Type "{Enter}" // Initiate the search Type "{Esc}" // Cancel the search Wait a split second Type "{Tab}{Tab}" // Navigate to the field i want to reach This approach is fussy. It takes trial and error to get the timing right, and to work out what text to search for. But with effort, I can usually get it to work almost 100% of the time.
  6. I would find it be helpful to see the code you've tried, and to look at some of the actual data. When you say, "I'd like to be able to do something different every time %T[1]% changes", I think you're saying you want to compare the value of %T[1]% against the value obtained the last time you triggered the macro. If that's the case, make sure your macro begins with "Variable Restore" and ends with "Variable Save."
  7. Today I learned that in Microsoft Word, Alt + Numpad 5 is the hotkey to select a table. With this new factoid in mind, I began to write a Macro Express script to do something with it. The script runs through a multi-step process that selects an entire table, copies it, assigns the data to a variable, parses the data, etc. The problem is that my script, which starts with this line... Text Type (Simulate Keystrokes): <ALT><KEYP5> ... doesn't select the table. Instead, the script inserts an emoji for the club, as in the suit in a pack of playing cards: ♣ I tried different hotkey activations for my macro, including "Alt + /" and "Ctrl + /" but the result was the same. I tried <ALTD><KEYP5><ALTU>. Same thing. Any ideas on why I'm getting an emoji instead of a key press?
  8. Maybe something like this? I opted for hotkey activation, and chose LMouse as the hotkey. Lock Keyboard and Mouse Wait for Left Mouse Click // One click On Error Catch Error: Condition was not met within the specified amount of time Text Box Display: One click Macro Stop End Catch Error End Error Text Box Display: Two clicks Unlock Keyboard and Mouse A script like this needs to be window or program specific. Otherwise, left clicking anywhere, and in any context, will trigger the macro. Which you probably don't want to happen!
  9. Very nice, rberq! I'd be curious to learn how your macro detects the second key press. Once upon a time, I wrote a macro activated by Esc. If I pressed Esc once, the macro outputted Esc. If I pressed it twice, the macro outputted Esc twice. But if I was impatient and quickly pressed Esc three times, the macro closed the current window. I eventually gave up on this macro. Initially it was fun to watch a window close by being persistent with Esc. But after a few days, I tired of the delay when pressing Esc once, as the macro doesn't send keystrokes until the last line of the script. (I press Esc dozens or hundreds of times a day, so I found the delay too noticeable.) But your idea of only waiting for a second key press might be the solution that eluded me. Simplicity trumps cleverness!
  10. This simple macro that I developed last summer hasn't made my life any easier, but it's simplifying someone else's. It's a way to drag the mouse using the absolute minimum amount of physical effort: no clicks, no holding down mouse buttons. All he has to do is point to the starting location, point to the end location, and the macro does the heavy lifting. Due to a congenital condition, this guy has limited hand strength. Holding down mouse buttons becomes very tiring very fast. But some tasks he performs MUST be done by dragging. There's no keyboard equivalent. Here's how the macro works: 1. He hovers the mouse pointer over the location the drag will start. (No need to click.) 2. He triggers the macro. 3. The macro waits five seconds while he moves the pointer to the target location. (Again, no need to click.) We started with a two second wait, but found it wasn't always enough time. If he's selecting text: the words between the start and target location get selected. If he's dragging an object: the object moves from the start location to the target location. Here's the script: Mouse Left Button Down Delay: 5000 milliseconds Mouse Left Button Up
  11. During the past year, has there been a Macro Express script that has made your life a little easier?
  12. The standard method to give keyboard input focus to the menu bar is to press either Alt or F10. If the menu bar (or ribbon) can be interacted with via keyboard, focus will jump there, and you will see it. Then menu items can be activated via arrow keys and/or "accelerator" keys. For example, for the File menu, pressing Alt or F10 will change the appearance of File: the "F" will be highlighted, or underlined. If this method works, a macro to navigate through menus can be simple. In pseudo code: Type F10 // Activate the menubar Type F // Choose the _F_ile menu Type A // Choose Save _A_s Sometimes you will need to insert a short delay between certain steps. 100 to 200 milliseconds is usually enough.
  13. Look for a file with the .wcfg extension. That's were Macro Express stores configuration information. The file might be in the folder as the .mex file. Or the file might be in a subfolder of that folder. Exit Macro Express. Rename or delete the configuration file. Restart Macro Express. Choose your Macro Express Preferences. Export the configuration file.
  14. I don't know about coupons, but I recover the cost of Macro Express, in terms of time-savings, at least once a day. I've been using Macro Express for about 20 years, which is about 7000 days. To calculate my savings, multiply the number of days by the cost of the product, which is currently $70. So the value of a coupon that I have been redeeming daily by using Macro Express is about $49,000!
  15. After you copy the text to the clipboard, you will need to do three things: 1. Transfer the contents of the clipboard into a variable. 2. Do as Cory suggests: "trim" the variable. Trim means to delete spaces from the start and end. 3. Transfer the contents of the variable back to the clipboard. For example, if this is in your clipboard at the start: " Hello World " The clipboard will be there after you've completed the three steps: "Hello World" The Macro Express code looks something like this: // 1. Transfer clipboard to string variable %Clip% Variable Set String %Clip% from the clipboard contents // 2. Trim %Clip% Variable Modify String %Clip%: Trim // 3. Transfer %Clip% to the clipboard Clipboard Start Copy Text Type (Simulate Keystrokes): %Clip% Clipboard End Copy
  16. There's the "Restart Macro Express" instruction, which closes and relaunches the program in a couple of seconds. But I encourage you to submit a feature request: update the monitor count without the need to exit and restart MEP.
  17. I think Cory is right. Macro Express doesn't "know" which .mex file to load. Perhaps you renamed the .mex file on your old computer, or you created an entirely new .mex file. In both cases, you'll need to find the .mex file on your new computer, and then open it. Macro Express loads the most recently-opened .mex file by default. If you don't know or don't remember the name of your .mex file, open the Macro Express Explorer on your old computer. The name of the .mex file displays near the top-left corner:
  18. This little script seems to work without rebooting or restarting Macro Express: Variable Set Integer %x%: Set to Number of Monitors Text Box Display: %x% It can be activated by pressing a hotkey, some kind of fancy mouse click, etc. But maybe for your group, the "safest" option would be to schedule it to run every, say, five or ten minutes.
  19. Like Cory, I've written macros for tasks like these, but I've found built-in methods, like Mail Merge, usually accomplish much the same thing much easier. If you don't want to use Mail Merge, there may be ways to semi-automate the process without using macros. For example, prepare an outgoing message that includes the two attachments. Save it as a draft. Go into the "Drafts" folder. Copy the message, and paste it repeatedly until you have pasted in the number of messages you need. You will still need to go into each message and insert email addresses. But if the number of messages is relatively small, these kinds of "tricks" significantly reduce the effort.
  20. If the point of this macro is to automate the collection of information to a file, I think I would want that file to remain open. I wouldn't want to open and close the file every time I activated the macro. This version displays the file for one second after the paste operation -- just enough time to visually check the copied text has arrived -- and then switches back to the original window. Variable Set String %WinTitle% to topmost window title Clipboard Copy Window Activate: test.txt - Notepad // File that contains the copied information Text Type (Simulate Keystrokes): <CONTROL><END><ENTER> // Go to end of file and start a new line Text Type (Simulate Keystrokes): <CONTROL>v // Paste Delay: 50 milliseconds Text Type (Simulate Keystrokes): <CONTROL>s // Save Delay: 1000 milliseconds Window Activate: %WinTitle% <VARIABLE SET STRING Option="\x05" Destination="%WinTitle%"/> <CLIPBOARD COPY/> <COMMENT/> <WINDOW ACTIVATE Title="test.txt - Notepad" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006" _COMMENT="File that contains the copied information"/> <COMMENT/> <TEXT TYPE Action="0" Text="<CONTROL><END><ENTER>" _COMMENT="Go to end of file and start a new line"/> <TEXT TYPE Action="0" Text="<CONTROL>v" _COMMENT="Paste"/> <DELAY Flags="\x02" Time="50"/> <COMMENT/> <TEXT TYPE Action="0" Text="<CONTROL>s" _COMMENT="Save"/> <DELAY Flags="\x02" Time="1000"/> <COMMENT/> <WINDOW ACTIVATE Title="%WinTitle%" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
  21. This seems to work and runs relatively quickly. The delays may need to be increased. (It might be possible to reduce them.) You'll want to change the file name that receives information from the clipboard. Clipboard Copy Variable Set String %WinTitle% to topmost window title Program Launch: "notepad.exe" (Maximized) Parameters: c:\tmp\test.txt Wait for File to be Ready: C:\Tmp\test.txt Text Type (Simulate Keystrokes): <CONTROL><END><ENTER> // Go to end of file and start a new line Clipboard Paste Delay: 50 milliseconds Text Type (Simulate Keystrokes): <CONTROL>s // Save the Notepad file Delay: 50 milliseconds Window Close: test.txt - Notepad Window Activate: %WinTitle% <CLIPBOARD COPY/> <VARIABLE SET STRING Option="\x05" Destination="%WinTitle%"/> <PROGRAM LAUNCH Path="notepad.exe" Mode="\x02" Parameters="c:\\tmp\\test.txt" Default_Path="TRUE" Wait="1" Get_Console="FALSE"/> <WAIT FOR FILE TO BE READY Filename="C:\\Tmp\\test.txt" Time="0" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="1"/> <TEXT TYPE Action="0" Text="<CONTROL><END><ENTER>" _COMMENT="Go to end of file and start a new line"/> <CLIPBOARD PASTE/> <DELAY Flags="\x02" Time="50"/> <TEXT TYPE Action="0" Text="<CONTROL>s" _COMMENT="Save the Notepad file"/> <DELAY Flags="\x02" Time="50"/> <WINDOW CLOSE Option="\x01" Title="test.txt - Notepad" Partial="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <WINDOW ACTIVATE Title="%WinTitle%" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
×
×
  • Create New...