Jump to content
Macro Express Forums

acantor

Members
  • Content Count

    1,014
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by acantor

  1. An update on editing "Get Control" information in the Direct Editor: The approach seems to work only temporarily before Macro Express throws errors. (Typically, that the control does not exist). I'm trying to understand what is causing the command to stop working. It's puzzling that it works like a treat for awhile, and then stops. It seemed so promising. In one test, I was able to copy information from Outlook while working in a different application, and without bringing Outlook into the foreground. My initial theory was that the failures might result from
  2. Hi Terry, I have a Macro Express script that I use to move between Outlook controls and show three things about each: its class, its text, and the location of its top-left corner. The macro has helped me puzzle out controls, at least a little. If you (or anyone else) might find this useful, I would be happy to post it here. The script can be adapted to work in other applications.
  3. The "Get Control" instruction saves information about a control (e.g., a button, edit box, pane, etc.). Macro Express includes a capture utility to gather information by dragging the mouse pointer over the control, and saving it to a control variable. When I use Get Control, my code usually looks like this: Get Control: (OUTLOOK.EXE) Using z-order -> %Control% Get Control Class from %Control% into %ControlClass% Get Control Text from %Control% into %ControlText% The first line captures information about the control. The following two lines extract information ab
  4. Edit: I simplified all three scripts by removing an unnecessary variable. The revisions make the rules easier to understand. My solution, which serves as replacement for Outlook 2019's Move to Folder commands, consists of three scripts: - A list of rules. The nickname for the macro is "Move Message Rules" - A script to move the selected message from the main Outlook 2019 user interface. I suggest setting the macro scope to window, partial match = " - Outlook" - A script to move the open message. To ensure availability in HTML, Plain Text, and RTF messages, set the scop
  5. Hi Cory, I was wondering whether someone was going to suggest built-in rules! Building a set of rules is the smart way to meet the challenge. But the reason for this challenge is less about doing things efficiently, and more about scratch-building one's own software tools... because the exercise can deepen one's appreciation of what can be accomplished with Macro Express. You appear to be one of the most sophisticated macro developers on this forum, so I would be very curious to learn how you might tackle this challenge.
  6. The challenge is to write a Macro Express script to analyze an email message, and on the basis of the analysis, automatically do something to the message. For example, the macro might move the message to a certain folder, flag it as important, delete the message, or whatever. To provide data for your macro, gather information from the user interface of your favourite email program. For example, your script might copy the name of the sender, the subject line, the message body, the date, etc. To simplify the challenge consider extracting only one or two pieces of information. Per
  7. I don't think I would allow a macro to act on the entire content of my inbox. A little too risky! But I can imagine a script that acts on individual email messages. I'm thinking of a hotkey macro that parses a message for one or two pieces of information, e.g., the subject line and the sender's email address. For me, one or both fields would provide enough information to decide which folder to store that message in. I keep most messages in my Inbox, and only move small numbers of incoming messages into a handful of folders. So my approach might not be practical for some
  8. This could be the basis for a good challenge: write a macro to analyze an email message and decide what to do with it based on its sender, subject, or whatever. Seems like it would be a very useful tool.
  9. The solution that I settled on is nothing like I expected. On my Windows 7 machine, my script outputted sequences of four or five keystrokes to activate “New Folder” buttons in “Save As” windows. It worked perfectly for years. When I upgraded to Windows 10, I noticed that the sequence of keystrokes was different. After revising my old macro, I realized that the key sequence sometimes failed. The reason: several fields in “Save As” windows are flaky. At least one of them has a tendency to steal focus. I tried Cory’s approach of using cont
  10. I THOUGHT this was a straightforward challenge. But the longer I tested my solution (which I recently updated for compatibility with Windows 10 and Office 2019), the more often it failed. I also tried Cory's proposed solution. The macro worked perfectly. But as I continued to use it, it began failing -- but for different reasons than mine. Finally, I think I'm zeroing in on a script that reliably creates a new folder in the Save As dialog box -- but only under certain conditions. I'll post it in a day or two.
  11. Hi Cory, It turns out there are unanticipated side-effects to the method you proposed. For reasons I don't understand (at least not yet) sometimes the Address field contains the full path (e.g., c:\Users\Alan\Documents\), and sometimes it contains just a word: "Documents". I assume it's a shortcut of some kind. If the control grabs "Documents" instead of the full path, the "Create New Folder" instruction fails. There is a workaround, but it's not quite as clean as one might hope. I think the source of the problem relates to how Microsoft now handles the Add
  12. Hi Cory, There is an interesting approach. I find that in Windows 10 and/or Office 2019, Macro Express sometimes struggles trying to capture control information. But I just tried in two "Save As" dialog boxes, and I see using controls to capture the Address line just might work. Not sure whether there will be complications that will force me to resort to mucking about with the user interface!
  13. If it's any consolation, in Office applications, Microsoft changes the key sequences for performing everyday tasks, as well. That means that MEP scripts must be revised. For example, in Word 2003, to format text in three columns was this reasonably logical and understandable sequence of four key presses: Alt [ activate menu bar ] o [ Format - Microsoft chose "o" for "Format" because "f" was "File" ] c [ Columns ] 3 [ 3 columns ] In Word 2019, it's this hard-to-learn and -understand sequence: Alt [ activate ribbon
  14. This isn’t a hard challenge. But I’m finding the macro I built to be indispensable. I use it almost every day, and sometimes many times in an hour. When saving a document, email message, image, web page, etc., "Save as" dialog boxes in most applications includes basic file management functions. For example, you can navigate from folder to folder, choose different file types, delete files, rename files, change the view, sort and filter, etc. These tasks can be done by pointing and clicking, and with a bit of effort, by pressing keys on the keyboard. I
  15. It's easy to change a macro activated by hotkey into a macro that is activated by the window title. In fact, the same macro can be activated by either a hotkey, or a window title. Open the script in the Macro Explorer, and go to the "Activations" tab. Click "Add" and then choose "Window Title." There are a lot of options, e.g., window gains focus or opens, partial or exact match of the title, etc. Some options are more reliable than others: for example, some people on this forum (but not all), recently noted that a trigger of a window gaining focus worked better than a trigger of a
  16. It might be possible. Perhaps captures the current window title, revise it (or prompt the user to revise it), and save the result in a global variable that is restored the next time the macro is activated? Store the new name in a file that the macro reads when it is run? Try to avoid creating a macro that modifies another by manipulating the MEP user interface. I know it's possible because I've done it, but phew!!! It was a lot of work. Although result was almost 100% reliable, it failed occasionally... and spectacularly.
  17. I just created a Macro Express script scoped to Google Chrome. It's triggered by Alt + Y: Text Type (Simulate Keystrokes): <CONTROL><SHIFT>o It brings up the Bookmarks screen. I'm not sure why it's not working for you. Try deleting the line and recreating it. If that doesn't work, try recreating your entire script from scratch.
  18. I don't think it matters in this case, but there is something to keep in mind about the "Text Type" instruction. The input is case sensitive. For example, Text Type (Simulate Keystrokes): <CONTROL>B is equivalent to: Text Type (Simulate Keystrokes): <CONTROL><SHIFT>b If you want Ctrl + B, do this: Text Type (Simulate Keystrokes): <CONTROL>b Not this: Text Type (Simulate Keystrokes): <CONTROL>B
  19. Hopefully this is the final refinement! Once I had a script to insert the texts in sequence, it seemed reasonable to make a second script to insert the texts in reverse order. I have assigned Keypad period to go forward, and Keypad zero to go backward. In actual use, press the Forward key to cycle forward. Text 1 --> Text 2 --> ...--> Text 5 --> Text 1... Press the Backward key to cycle in reverse: Text 1 --> Text 5 --> Text 4... FORWARD: // Cycle FORWARDS through five pre-defined texts, %Text[1]% - %Text[5]%, and insert into a
  20. Since "upgrading" to Windows 10 about six months ago, I've been underwhelmed by its lacklustre performance, whether or not I am using macros. Many hotkey and shortkey scripts fail to run the first time, and sometimes the first several times, I activate them. My pixel hunting scripts have become useless, even after I modified them to check every 10 or 100 pixels instead of every pixel. Everything happens in slow motion in Windows 10. The performance of my first computer (an XT clone running MS-DOS, circa 1988) was snappier!
  21. // Cycle through five pre-defined texts, %Text[1]% - %Text[5]%, and insert into a field. // Each time text is inserted, the field gets selected. // When the macro is activated again, the next text in the cycle replaces the old. // The first time the macro is activated, insert %Text[1]%. // The second time the macro is activated, insert %Text[2]%. // etc. // The sixth time the macro is activated, reset the counter to 1, which restarts the cycle with %Text[1]%. // Counter %x% tracks which text was last inserted. // The value of %x% is saved each time the macro completes, and restored each t
  22. Here is a refinement. In this version, the five texts are saved in a plain text file, which will allow the user to edit the texts. In the file, each text must be wrapped in quote marks, and there must be a Tab character between the texts. Note 1. You must substitute a press of the Tab key for each [TAB] in the file.) Note 2. When saving the file, make sure the encoding is set to "ANSI" not "UTF..." The scripts appears in the next message...
  23. Check with Insight, as my recollection may not be accurate, which is that Macro Express 3 became Macro Express 5, and Macro Express 4 morphed into Macro Express 6. The two new products were harmonized, e.g., Version 5 began supporting named variables. That sort of thing. Version 5 lacks a handful of advanced features such as Boolean variables, Code Snippets, and the like. I made the switch to Pro 11 years ago, so my memory of the switchover is a bit fuzzy. But I recall early releases of MEP did not seem as stable as the original ME. But the stability issues seem to ha
  24. Thank you, Cory! I had no idea that Notepad now supports Unicode. Saving the file and specifying ASCII encoding fixed the problem and solved the mystery.
×
×
  • Create New...