Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,532
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. You will likely need completely different strategies to detect system changes when running MEP in a networked environment. I have experienced this with macros that detect pixel colour changes. I needed to develop different macros for use over a Virtual Private Network. I ended up using a lot of timed delays, which I normally avoid.
  2. I don't think you can disable them. But you can assign them to hotkeys that you will never use, e.g., Win+Ctrl+F12.
  3. Yep, you have to do it via the Bios. I am quite sure you cannot send the Fn key via Macro Express.
  4. On my computers, Macro Express does not consume as much CPU is yours. Not nearly as much. I have about 700 Macro Express scripts, with one-third disabled at any time. So I have 400 or 500 active macros. Presumably only the active scripts draw system resources. During the past 1 1/2 months, I have run about 150 macros. Which means that I use only one third of all my active macros regularly (or semi-regularly). Have you tried disabling most of your scripts, and rechecking CPU usage? Or creating a new macro file, and importing only your most important scripts? You do not need macros to restart Macro Express. Create a shortcut to macexpro.exe and place it on the desktop. Open its properties, and assign a "shortcut key" to activate the shortcut. Alternatively, don't assign a shortcut key, and go to the desktop when you need to restart Macro Express, and double click the shortcut icon.
  5. I'm glad it works, but it really is only for emergency situations, when a macro locks up your system. The downside is that you must restart Macro Express afterwards. But that is preferable, I think, to rebooting the computer. Some icons in the system tray do Not get updated right away. The "solution" is to hover the mouse pointer over the older of the two Macro Express icons. This extra icon will usually vanish after a few seconds.
  6. Right click the desktop, and choose "New" and then "Shortcut." For the "location," type this: taskkill /f /im macexp.exe For the "name", type whatever you want, but maybe this would be good: End Macro Express! If you want to be able to access the shortcut without minimizing any windows, assign a shortcut key: go the Properties for the shortcut, and specify a "shortcut key." F10 is a safe bet, and conflicts with few program-specific hotkeys.
  7. Good catch. I can now replicate this problem. The problem does not occur when left clicking in other context menus. But the detect left click command is ignored when I activate an icon in the System Tray, and then left-click anywhere in the context menu.
  8. I am not able to replicate the problem. This MEP script waits for to a left click, and signals when it has happened. Then it does the same thing for a right click. Wait for Left Mouse Click Text Box Display: Left Mouse Click detected Wait for Right Mouse Click Text Box Display: Right Mouse Click detected
  9. I can't think of a simple, straightforward, or programmatic way to do this reliably. You might have to settle for a fixed time delay. There may be complex, convoluted, and non-programmatic ways to detect when a menu disappears. But there may be a point of diminishing returns. Is it worthwhile to spend, say, 10 hours, to develop a workaround? (The answer may be "yes" if doing so improves your comfort and deepens your understanding of macro scripting.) Time delays are not pretty, but get the job done.
  10. There are situations when the hotkey will not stop a running macro. In that case, it's good to have another way to bail out. I use taskkill.exe. I have a desktop shortcut that runs taskkill C:\Program Files (x86)\Macro Express Pro\MacExp.exe, I have assigned it to a hotkey (via the shortcut's Properties) so that taskkill can be activated without the need to minimize anything.
  11. I hadn't realized it was possible to type in a date format. I wish I had known that years ago. On the other hand, not knowing gave me more time to get familiar with Macro Express variables and conditional statements. The comprehensiveness of Macro Express still surprises me at times.
  12. I forgot about that! Good catch. If one needs the date in a format that MEX doesn't support, say DD-MMMM-YYYY-HH-MM or YYDMM, it's good to know how to build a script from first principles.
  13. The first example is Macro Express code to produce the date in D M YYYY format. The code uses three integer variables, N1 (day), N2 (month), and N3 (year). In the second example, the date outputs as D MMMM YYYY. Variables N1 and N3 are reused, but I change the month from integer variable N2 to text variable T1. // D M YYYY Format: Variable Set Integer %N1% from Current Day Variable Set Integer %N2% from Current Month Variable Set Integer %N3% from Current Year Text Type: D M YYYY: %N1% %N2% %N3% // D MMMM YYYY Format: Switch (N2) Case: 1 Variable Set String %T1% "January" End Case Case: 2 Variable Set String %T1% "February" End Case Case: 3 Variable Set String %T1% "March" End Case Case: 4 Variable Set String %T1% "April" End Case Case: 5 Variable Set String %T1% "May" End Case Case: 6 Variable Set String %T1% "June" End Case Case: 7 Variable Set String %T1% "July" End Case Case: 8 Variable Set String %T1% "August" End Case Case: 9 Variable Set String %T1% "September" End Case Case: 10 Variable Set String %T1% "October" End Case Case: 11 Variable Set String %T1% "November" End Case Case: 12 Variable Set String %T1% "December" End Case End Switch Text Type: D MMMM YYYY: %N1% %T1% %N3%
  14. This should work as long as a field is not focused, in which case it is the field that is selected and copied rather than the page. Text Type (Simulate Keystrokes): <CONTROL>a // Select all Text Type (Simulate Keystrokes): <CONTROL>c // Copy to clipboard Variable Set String %Clip% from the clipboard contents
  15. What folder are you referring to? A "category" folder in the Macro Explorer? A folder (directory) that contains exported macros?
  16. I have written about the topic. See, for example: http://www.cantoraccess.com/publications/macros_2005_csun_radical.shtml It's only a brief description, but maybe enough to get you going. The section is called "Record and playback commands in Microsoft Office applications." The commands I mentioned were moved from in Word 2007 and 2010, so you may need to hunt around for the commands that I described.
  17. I don't think so. Macro Express can extract information about itself -- see "Variable Set From Misc" for examples -- but the last macro run time is not one of them. Suggest it as a new feature!
  18. Thank you! I can't wait to take the new release through its paces.
  19. It's true that macros that search for text on a webpage, and then navigate to them via the user interface, are less than 100% reliable. But put enough effort into it, you may find that speed and reliability can be boosted. It's a matter of trial and error + creative problem-solving. There are other search techniques that may be more or less reliable. I have developed many Macro Express scripts for webpages that search for specific colours. One of these macros performs 1000+ steps to deduce the location of the target, but because I am using the pixel colour at coordinate (X, Y) test instead of the move the mouse cursor to coordinate (X, Y), the entire testing process takes only a fraction of a second. It's also fairly reliable, as long as I don't mess with the configuration of the browser too much.
  20. If the field you are trying to give focus to is on a web page, you might be able to do this: Search for text on the page that is near the field. Cancel the search. Tab or Shift Tab as many times as necessary to reach your target. E.g., Type: <CONTROL>f // Find on this page. <F3> works in Firefox, as well. Type: Please enter your email // Choose the shortest unique word(s) near the target Type: <ENTER> // Initiate the search Type: <ESC> // Exit the search Delay 200 ms // You may need a delay to allow focus to pass from the search box to the page Type <TAB><TAB> // Tab to the target. You may need additional delays between other steps.
  21. Let's see the code. My Spidey-sense tells me that you need a short delay before the mouse click statement. Start with 2000 or 3000 ms, and work your way down to an interval that is short and reliable.
  22. It might be worth trying to do the same thing by interacting with the "View Icon" control programatically rather than clicking on coordinates.
  23. A few caveats about the Alt + D approach... 1. The technique is only really reliable on a newly loaded page. On a page that you have already navigated on, pressing Alt + D will move the cursor to the address line, but when you tab, focus could end up on the most recently visited link instead of the first link. (This behavior may be browser specific). 2. The hotkey may fail on pages that contain non-W3C technologies such as Flash and PDF. (JavaScript and Ajax can also throw things for a loop.) 3. The number of times that you must tab after pressing Alt + D to reach the first link is a function of how the browser is configured. For example, if you have toolbars between the address line and the active window, you may have to press the tab key several times to navigate through the toolbars. Add-ins, configuration settings, etc. can also affect the number of tabs. 4. Under ideal conditions, there is no need to insert a delay between the tabs. But on some pages, tab-key navigation is unpredictable without a short delay between each simulated keypress. I have noticed this most often on pages that are heavy with JavaScript.
  24. When I was messing with Regedit a few years ago, I was able to find excellent answers to most of my questions through one of the on-line forums.(I think it was an AutoHotkey subforum.)
  25. I think what Cory was suggesting is a way to NOT use a program's menus (or ribbons) to open a specific file. Program Launch: "EXCEL.EXE" (Normal) Parameters: "c:\tmp\test file.xls" As for your question about saving the file... are you asking how you do it with a macro? It helps to know the keyboard shortcut, Ctrl + s, or using the Ribbon, Alt + f followed by s... // Use Excel's built in hotkey to save... Text Type (Simulate Keystrokes): <CONTROL>s // Interact with the ribbon via typing simulation to save.... Text Type (Simulate Keystrokes): <ALT>f // File ribbon Text Type (Simulate Keystrokes): s // Save
×
×
  • Create New...