Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,532
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. There may be better ways to navigate to a target than by clicking the mouse cursor. In many browsers, you can reliably navigate to objects by searching for adjacent text. For example, let's say that you want to automatically sign in to a web site. The task is to move the cursor to the "User Name" edit box, enter your user name, then enter your password, etc. In pseudo-code: // Start a search on the page <CONTROL>f // Wait for the Find box to receive focus Wait 200 ms // Search for the phrase "User Name" Text Type "User Name<ENTER>" // Assume search string was found. Escape out of search Text Type "<ESC>" // A short delay here may make the script more reliable Wait 200 ms // Focus is now on the label next to the field. Tab to it... Text Type "<TAB>" // Enter the user name, tab to the password field, and enter the password Text Type "georgie123" Text Type "<TAB>" Text Type "this_is_my_password" // Activate the "Submit" button. (Pressing Enter does the trick) Text Type "<ENTER>" In certain browsers, there are even more reliable ways to do this. In Firefox, for example, there is a command that searches only for text that occurs within a hypertext link.
  2. OK, so there is no direct way to count the number of instances of y within x. Oh, well... My solution is almost identical to Cory's, although his is more versatile. (For my purpose, the string to count is only one character long, so I do not need the division step.) Thanks to both of you!
  3. Thank you, Cory, This is similar to what I came up with. I am wondering whether there is a way to split the string into two strings, one that includes everything to the left of @, the other everything to the right of @, manipulating the two strings, and then reassembling. This problem has just become more challenging: I found examples where there are two email addresses!
  4. In MEP, is there a direct way -- or even an hack! -- to count the number of times that a specific string appears in a text variable? In pseudo-code: %Text% = "Abc 123 def 345 A" Count("A" in %Text%) = 2 Count(" " in %Text%) = 4 Count("Abc" in %Text%) = 1 Count ("Hello" in %Text%) = 0 Or am I stuck with having to "manually" parse the text variable?
  5. Get Control: (EXPLORER.EXE) Using z-order -> %TaskBar% Set Focus to %TaskBar% This seems to work. I set: Top Level Window Caption = * Use wildcards: checked
  6. I am scripting a macro to extract an email address from a text variable called, say, %RawText%. The content of the variable may take several forms, e.g., S. Smith [s.smith@xyz123.com] [s.smith@xyz123.com] s.smith@xyz123.com s.smith@xyz123.com on behalf of S. Smith I would be curious to learn how others would approach this so that only the email address remains.
  7. You may need a time delay before <ENTER>. Alternatively, instead of pressing <ENTER>, try substituting <TAB>. That will move focus to the next object, but it should leave your selection intact. Also, instead of navigating through the list using down arrow key, can you use letters instead? For example, if you want to choose "Denmark" from the list, pressing D should get to the item, or close to it. Sometimes, it works to press the first several letters of the target: "Den..."
  8. The Print Screen command is available from a drop-down list, along with keypad keys and miscellaneous others. In fact, I think the list is labeled "Miscellaneous."
  9. Text Type: <ALT><PRTSCR>
  10. Part of the solution may be to navigate to the Address Bar – the default hotkey in Windows Explorer is Alt + D. Then, you can easily copy the path to this folder. To copy the filename, select its icon. Pressing F2 will make it editable (and selectable, and copyable!) You may need to adjust Windows Explorer "Folder Options" so that the address bar is displayed. You may need to display filenames with the extensions showing rather than hidden. It may help to choose a View such as "Details" or "List."
  11. You can do things like this… // // Check colour of each pixel along a vertical line, to a maximum of %N1% pixels // Repeat with Variable: Repeat %N1% times Mouse Move: 0, 1 Relative to Last Position Get Pixel Color from Beneath the Mouse into %N99% If Variable %N99% Equals "6050636" // Colour of the 1-pixel wide border along top and bottom of the column Repeat Exit End If End Repeat
  12. Article on macros quadrupling productivity Although this case study deals with an employee with an upper-body mobility disability, my experience is that people without disabilities who use macros are also able to work significantly faster, more accurately, and with less mental effort.
  13. You could wrap a simulated arrow key press in a loop, maybe something like this: Repeat Start (Repeat 100 times) Text Type (Simulate Keystrokes): <ARROW DOWN> End Repeat
  14. I don't think that there is a reliable way to do this, but you might want to investigate the possibility of using the new Z-order options that are part of the "Get Control" commands in Macro Express Pro.
  15. Would it work if you clicked part of the window instead of the task bar? It's fairly straightforward to activate a macro by, for example, right clicking a maximize button, a title bar, or a menu. Then your script could collect information about the focused window.
  16. I don't think so. At least not a built-in command. What happens when two (or more) windows are tiled without overlapping? In that case, there could be two (or more) topmost windows. Macro Express cannot read the mind of the user. It cannot know what the user was doing, and in which window, prior to activating a macro. It can only act upon information available the moment the macro is activated -- unless information about window usage is being logged. It might be possible to create macros that track each window that is activated, and that log this information in a file. My guess is that you would need 26 macros: one activated by window title that contains an "a," another by a "b," etc. When a window gains focus, the name of the window is recorded and saved to a file. (I can imagine all sorts of problems in trying to do this!) When the macro in the System Tray is activated, it parses the file to determine the last window title to have focus. Is it possible to do this? Maybe. But it may be too complex to be practical. Are you sure you can't use hotkey activation?
  17. You can semi-automate the process of deleting the delay commands, but you may not like the result. Your script may become unreliable. But if you want to proceed, here is one way to do it: Create a new Macro Express macro. Let's chose F12 as a hotkey activation. The script consists of three lines, which you can paste into the Scripting Editor. Text Type (Simulate Keystrokes): <F3> Delay: 100 milliseconds Text Type (Simulate Keystrokes): <DELETE> Save the macro, and open the script that contains all of the Delays you want to get rid of. Press Ctrl + F to initiate a search. Type "Delay" as the search term. Click "Find Next." Press Esc to cancel the search. At this point, you could press F3 to find for the next instance of "Delay." But instead, we will use the macro created above, which is activated by pressing F12. Press and release F12 repeatedly. Each time you do, another Delay command will disappear.
  18. I don't think MEP can detect which window was focused before you activate the macro. If the macro must be activated from the System Tray or Desktop, problems are inevitable. You might try switching focus using Alt + Esc or Shift + Alt + Esc, but my guess is that you will run into the same problem as you did when using Alt + Tab. Your best best may be to change the activation to Hotkey or ShortKey.
  19. I usually avoid doing this: Text Type: <CTRLD>f<CTRLU> When I can do this: Text Type: <CONTROL>f
  20. The answer depends on what exactly you are trying to do. Split the username after the third character? Or between a vowel and consonant? Something else? It's not clear from your example. But it sounds interesting…
  21. Aha! The following script is, so far, working as intended. I will continue testing. Thanks again, Arek, for pointing me in the right direction. Text Type (Simulate Keystrokes): <CONTROL><SHIFT><ARROW LEFT> Text Type (Simulate Keystrokes): <BACKSPACE> Text Type (Simulate Keystrokes): <CTRLD>
  22. Nice work Arek! Thank you for taking on this project. The symbol that appears when pressing Ctrl + Backspace in Notebook has nothing to do with XP. It's been a "feature" since (at least) Window 95. The version of Notebook in Windows 7 does exactly the same thing. A lot of applications do the same thing, including Macro Express. For example, try it in the "Nickname" field, and when editing a comment. It may that this script cannot be made to work without "stuttering," or without performing finger acrobatics (e.g., lift the Backspace key but keep pressing Ctrl.) I will try to build on your work! Thank you!
  23. I use Ctrl + Backspace constantly to delete back left at a time, but this hotkey does not work in every context. For example, it works in Word, Outlook, and WordPad, but not in Notebook, not on the desktop when renaming icons, and more. The solution: If you are a macro developer, you think in terms of macros! The basic MEP script is simple enough: <CTRL><SHIFT><LEFT> (Select word to the left) <BACKSPACE> (Delete the selection; and do nothing if no text is selected) The question: How do you do it in Macro Express so that the it fires continually while holding down Ctrl + Backspace. I can't make it work; it stops working as soon as I check "Activate as soon as the keys are pressed." Edit: The most likely reason the command won't work: Control (Ctrl) is part of the activation (Ctrl + Backspace). The command sends Ctrl + Shift + Left. So my guess is that Macro Express is having trouble handling the Ctrl key...
  24. This article describes ways to trigger Macro Express scripts with NaturallySpeaking, but the principles should be similar: Two Methods for Triggering Macro Express Scripts with NaturallySpeaking
  25. I didn't suggest the hotkey macro as a workaround, but as a diagnostic tool. Perhaps activating the command via F9 is conflicting with something outside of MEP. I would check properties for everything on the desktop. Perhaps one of the objects has been inadvertently assigned the F9 shortcut key, and that might be the source of the problem.
×
×
  • Create New...