Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,532
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. My guess is that Excel does not have focus when you activate the Popup menu item. If that's the case, Excel is not receiving the key combination.
  2. I am also noticing something unusual about assigning the Win key in ME Pro: Text Type (Simulate Keystrokes): <WIN> After running the command that includes this statement, nothing seems to happen. But then I press a key that includes <WIN> as a modifier. For example, when I press "D" or "P" the computer responds as though I had pressed <WIN>d (minimize all windows and show the desktop) or <WIN>p (display options). It would be interested to find out what happens with <WIN DOWN> and <WIN UP> At any rate, this behaviour is not as expected. You may have discovered a bug, so submit a report to the good folks at Insight Software!
  3. Could be a Windows 10 issue. There are no shortage of those! I'm using Windows 7 Pro.
  4. I don't think so. But that may be a blessing in disguise. I avoid "REPEAT UNTIL" because I've had too many experiences of freezes when the condition, for whatever reason, cannot be met. But you can test for two or more conditions using IF statements. My approach is to use a "failsafe" to exit the loop if the condition is not met within a reasonable number of iterations. For example, if I am checking pixel colours along a horizontal line, the failsafe value might be the width of the screen as measured in pixels. In pseudocode: // Check each pixel along (x, 100) for Colour = 11111 or Colour = 22222 Failsafe = 1200 x = 0 y = 100 Repeat Failsafe Times Colour = Pixel Color at (x, y) If Colour = 11111 OR If Colour = 22222 // Pixel has been found! ... Macro Stop Else x = x + 1 Repeat End // Pixel not found!
  5. I tried it using Beeps instead of sound files, and it worked, although the macro did not trigger until five or ten seconds after the run time.
  6. Update 1: I thought this might be a Microsoft Office issue, but the macros work fine in PowerPoint. Update 2: When the Macro Express hotkey is the same as a Word hotkey, the Word hotkey works. Usually the opposite is true: Windows "sees" Macro Express hotkeys first. Samrae, I will try your suggestion.
  7. I am developing Macro Express Pro scripts to run in Microsoft Word on a Windows 10 machine. Although the scope of my scripts are set to Global, my hotkey and shortkey macros are not activating while I am in Word. The scripts are activating fine in every other program. Changing the scope to Word doesn't help. Any thoughts on what might be blocking scripts from activating while I am in Word?
  8. I have taught many hands-on Macro Express courses, but none are currently scheduled. Most courses were hosted by my professional association, RESNA, and took place at its annual conference. So your best option to learn Macro Express is to apply the dual strategy used by many on this forum: 1. Learn Macro Express through trial-and-error experimentation. 2. Don't hesitate to ask questions on this forum! There are no shortcuts to learning a program like Macro Express. It's a sophisticated tool – it takes time and effort to get a handle on its complexities. Fortunately, the Help screens in Macro Express are actually helpful… perhaps the best of all of the scripting tools.
  9. You can do it with Macro Express Pro (or Macro Express 3) if you are content with a non-programmatic solution. Text Type (Simulate Keystrokes): <ALT>d // Go to address bar. Normally, it's selected by default Clipboard Copy Variable Set String %Address% from the clipboard contents
  10. I have never used it. But I have experimented with similar constructs in VB-like languages and in AutoHotkey, and I'm not sure that I can tell the difference. In Dragon Advanced Scripting, for example, I can do this with the SendKeys statement: SendKeys "Hello, World" or this: SendKeys "Hello, World", True The "True" argument is supposed to ensure that keystrokes are completely processed before the statement returns control to the procedure. I am not positive adding the argument makes a difference, or at least, a difference that is noticeable enough to enhance reliability. So what I often do is add a short delay: SendKeys "Hello, World" Wait 0.1 If the lack of a delay causes a Macro Express script to go wonky, I do exactly the same thing: Text Type (Simulate Keystrokes): Hello, World Delay: 100 milliseconds
  11. That's exactly how it works. I'm not sure how long I will be able to use this technique, as I've noticed that drop-down lists in Windows 10 are less likely to support incremental searches. Which is really unfortunate. It's a very speedy way to manually navigate to a target on a long list. It works when typing, and especially, it works when automating via macros. There is no way that I would have been able to make it work for the items that are 32 characters long if I had to type them manually. (The way that Microsoft implemented the incremental search, you cannot pause while typing. A pause of a fraction of a second resets the search.) The macro now executes more slowly. I had to add an IF statement within the repeat loop to check for one special case. There is an issue with one item on the list that causes the incremental search to fail. The extra test noticeably slows down the macro. However, that's the trade-off I needed to make so the macro run reliably from start to finish. Nevertheless, the development time for this macro, plus the extra five or ten minutes it takes to run it, still represents a tiny proportion of the mental and physical effort I would have expended to perform the task manually.
  12. Well, I actually considered your approach! It think it's workable, although it would be a pain to code. I might try it one day just to see if I can. But I found an alternative way to solve the problem that reduced the number of simulated keystrokes by a significant amount, maybe by a factor of 50 or 100. Instead of pressing down arrow keys, I now do incremental searches on the drop down list to navigate to the item I want. So to navigate to the 1000th item on the list, instead of pressing down arrow 1000 times, the macro types its name exactly how it appears. The length of the item names vary between three and 32 characters. So to reach the 1000th item, I only need to send as many characters are in its name.
  13. It's not really a problem, except, perhaps, of aesthetics! <Down %x%> is neater than a repeat loop. But I will get used to it! The macro extracts every item from a 1300-item long drop-down list. To navigate to all of list items, the macro needs to press the down arrow key over 800,000 times: 1 + 2 + 3 ... + 1300. It runs in about 15 minutes. I can't imagine how long the task would have taken had I done it manually, but I know I only spent 60 or 90 minutes scripting and debugging the MEX macro. Thank you, Insight Software Solutions, you saved me days (possibly weeks) of mind-numbing boring effort, as well as significant upper body wear-and-tear!
  14. I am scripting a macro that presses the down arrow key %x% times, where x is between 1 and 1300. In some scripting languages I can repeat a key press %x% times: <DOWN %x%> Is there a way to do this in Macro Express? Or should I make peace with repeating %x% times? Repeat with Variable: Repeat %x% times Text Type (Simulate Keystrokes): <ARROW DOWN> End Repeat Thanks!
  15. Glad to be able to help. If you can script something as complex as nested IF-THEN-ELSE statements, you can probably wrap your mind around SWITCH / CASE statements. The Macro Express Help on the topic is excellent. There may be times when SWITCH / CASE statements make for the cleanest code, but much depends on the number of cases. Sometimes I opt for IF-THEN-ELSE when there are not too many. Judiciously adding white spaces between blocks of code (i.e., blank Comment statements) can help add clarity to what would otherwise be convoluted code!
  16. Try something like this. The script tests whether the integer variable contains 01 and 99: Variable Set Integer %Value%: Prompt If Variable %Value% Contains "01" AND If Variable %Value% Contains "99" Text Box Display: Yes, %Value% contains "01" and "99" Else Text Box Display: No, %Value% does NOT contain "01" and "99" End If
  17. A VBA macro might be the ticket. Try recording the procedure using Excel's macro recorder, and then modify the code to create a more general solution. The folks on various Excel VBA help forums might be able to provide assistance.
  18. This approach solved a dropped character problem when I was creating ME macros for an Java application: In the Control Panel, go to Keyboard Properties, and reduce the repeat rate. Setting the value to 25% or 30% was enough to prevent characters from dropping when I sent input via Text Type.
  19. It sounds do-able with Macro Express, but it would be helpful if you would provide more details.
  20. Try adding a delay between the two rename commands. Start with three or five seconds. If that proves to be the source of the problem, then incrementally reduce the time until it fails again. Then bump up the delay slightly.
  21. If you created the macro by capturing your actions, the resulting script is likely extremely long. If it's sufficiently lengthy, the script will take time to execute. And while it's executing, you will be effectively prevented from doing anything else with your computer. There are many advantages of keyboard input over mouse input when automating repetitive tasks via macros: First, the number of keystrokes is significantly fewer than the number of mouse movements. Dozens, hundreds, or thousands of mouse movements can sometimes be replaced with one or two keypresses. For example, if you record yourself selecting an entire webpage by scrolling to the top, clicking in front of the first word, and dragging down to the end of the page, the capture can conceivably be a thousand lines long. But the same action can be accomplished by pressing a single keystroke: Ctrl + A. Second, a script consisting of keystrokes is more likely to work reliably. A recorded macro consisting of mouse actions may not work as expected if you change the zoom level in your browser or resize the window. Nor is your macro guaranteed to work if the web developers change a page's styles (e.g., typefaces, font sizes) or add or subtract content from the page. On the other hand, the hotkey for selecting an entire webpage will always work – at least, as long as a form element does not have keyboard input focus. Ultimately, if the macro is taking so long to execute that you are unable to do anything else, it's worthwhile rewriting the macro so that the task is performed via keyboard. If your computer is locked for a long time while your mouse-intensive macro is running, know that simulating the keystrokes won't prevent the macro from locking up your computer, but it will probably only do so for a fraction of a second.
  22. Could you describe in detail what are you trying to accomplish? If you are using Macro Express's capture feature, be aware that playing back a script may not give you the results you are looking for. A captured macro may not play back correctly when run in a different window. As a general macro scripting rule, I suggest avoiding mouse actions unless there are no alternatives. In browsers, there are ways to navigate, select, copy, and paste without the mouse. The ease of performing these actions sans mouse, however, depends on the browser and your browser settings. When dealing with web content, I find Firefox easier to work with than Internet Explorer or Chrome.
  23. Hi Terry, I recently completed a project of automating aspects of Excel using a different scripting tool (i.e., not Macro Express). For the first part of the project, the client's PC was running Windows 7. For the second part, the PC was a Windows 10 machine. A handful of scripts that worked beautifully under Windows 7 failed under Windows 10. So it would appear Microsoft has thrown curveballs to those of us who use third-party scripting tools. In every case I found workarounds; but the workarounds were not always elegant. In your situation, the next thing to try is alternative ways to copy the field. For example, instead of sending Ctrl + C, try copying the text via the context menu. Or cut the email address, pause for half a second, and paste (which will allow you to see whether the clipboard operation was successful.) Or just cut it, and forget about pasting it back. Or substitute Macro Express's clipboard commands when copying and pasting instead of Ctrl + C and Ctrl + X; or vice versa. If none of these approaches are successful, I would delete the macro and re-create it from scratch. On second thought, I would do this next! And if you are still not successful, report the problem to the good people at Insight Software. This may be a Windows 10 compatibility issue.
  24. I am using Windows 7, not 10, and Excel 2007, and not something newer. So things may be a little different on my computer. A few thoughts: 1. Try <Ctrl>k to open the hypertext link instead of opening it via the context menu. 2. I need to select the email address from the Edit Hypertext dialog box: <Ctrl>a should work, but so should <Home><Shift><End>. 3. Instead of opening the hypertext link, try editing the cell, something like this... <F2> <Home><Shift><End> <Ctrl>c 4. How about copying the cell directly, without editing it? <ARROW UP><ARROW RIGHT> // navigate to a cell <Ctrl>c
×
×
  • Create New...