Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,531
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. On Tuesday 3 July 2012, I will be leading a hands-on workshop on macros at the RESNA Conference in Baltimore. This session may be of interest to people on this forum. Feel free to pass this along to anyone who might be interested. You do not need to have macro or programming experience to take this course. The main focus of the course is Macro Express. I will also introduce AutoHotkey, and maybe VBA. Here is a summary of the course: Title: Macros, Hotkeys, Keyboard and Mouse Remappings, and other Computer Access Tricks Overview: Learn techniques for making inaccessible applications more accessible by modifying the behaviour of keyboards, mice, and programs to better fit the physical, cognitive, and learning needs of users. Objectives: 1. Participants will become acquainted with Macro Express: Know five macro activation methods; explore the Macro Express user interface; use the Scripting Editor to create one hotkey macro and one ShortKey macro; and set the scope for one macro. 2. Participants will become acquainted with AutoHotkey by taking a "guided tour" with the instructor, creating one hotkey macro, and remapping one key. 3. Participants will be able to change two behaviours via driver software settings; Change one behaviour of the mouse via Macro Express; and change the behaviour of the mouse via AutoHotkey. 4. Participants will be able to add a custom hotkey to a Microsoft Office application; assign a hotkey to any feature in Microsoft Word. — The cost of the course is $180 ($140 for students). There is a discount for members of RESNA. For more information about the Conference, and a registration form: http://web.resna.org/conference/2012-conference-documents/RESNA12_Prelimprog9.pdf (My course is described on page 16 of the preliminary program.)
  2. If you are hunting for the shape of the mouse cursor, you may need a delay before the IF statement. Try 300 ms; you may be able to reduce it to 10 or 20 ms, but start big and through trial and error, figure out how short a delay is enough.
  3. Yes, it's possible. In pseudo code, the script might look something like this: N1 = Width of Window N2 = 0 // Initial X value N3 = 100 // Y value of the row you want to search N4 = 12345678 // Colour of target pixel Repeat N1 times Move Mouse Cursor to (N2, N3) N5 = Pixel Colour Under the Mouse Cursor If N5 = N4 // Found! Mouse Left Click Stop Macro Else // Not found N2 = N2 + 1 End If Repeat End
  4. I suggest approaching key remapping decisions case-by-case. Sometimes overwriting a built-in hotkey causes problems, and sometimes not. I suggest trying. If there are unintended side effects, it's easy to fix.
  5. Hi Terry, Try Cory's suggestion: instead of pressing the hotkey, select it from the list. I was able to assign Win+B in Windows 7.
  6. I just tried creating six macros, each activated by one of the vowels. I could not figure out a way to prevent the other macros from firing when the title contained more than one vowel. For example, this script, called "A in title", is typical: Lock Player Macro Disable: E in title Macro Disable: I in title Macro Disable: O in title Macro Disable: U in title Macro Disable: Y in title Variable Set From Misc: "Name of Current Macro" into %MacroName% Text Box Display: %MacroName% Macro Enable: E in title Macro Enable: I in title Macro Enable: O in title Macro Enable: U in title Macro Enable: Y in title Unlock Player
  7. I tried this, but gave up due to system instability. But if you want to try, avoid these three approaches that caused more problems than they solved. 1. I created a macro activated when window title " - " opens. Many, although not all, windows have this three-character string (space hyphen space) somewhere in the title bar. As I enter this message on this forum, I notice that the title bar actually has two occurrences: Activating a macro - Macro Express Forums - Mozilla Firefox This approach doesn't work on windows or dialog boxes that have titles like these: "Find and Replace," "Downloads," "Warning!", etc. 2. I created 26 macros activated by window title. Each was activated by a different letter of the alphabet: "a," "b", etc. 3. A simplification of this was to create six macros, each activated by a vowel. I don't think I have ever seen a title bar in English that does not contain at least one vowel.
  8. I updated from Windows XP to 7, and the delay from activation to execution is present in both. So at least in my case, I don't think it is exclusively related to the OS. I wonder whether it is an MEP vs. ME3 issue. I don't remember these delays when I was using Macro Express 3. The problem may stem from the fact that I use NaturallySpeaking. I think I have noticed a few odd interations between the two programs, but I have not been able to sort them out.
  9. I have many macros triggered by the same hotkey, e.g., Alt + A. The scope for each script is different, so there are no conflicts. But often there is a delay between the time I press the hotkey and its activation, up to five seconds. I don't know if this observation is generally true for MEP, or whether there is something about the configuration of the computer I am using. Do others experience the same thing? If the number of active scripts with the same hotkey affects recognition speed, are there "tricks" to setting scopes so the window titles or program names are recognized faster? Exact vs. Partial Match? Long match text vs. short match text? Program vs. Window title? If a macro is disabled, is it completely ignored when another script triggered by the same hotkey is activated?
  10. Using the width and height of the current window... Variable Set Integer %WindowWidth%: Set to the Current Window's Width Variable Set Integer %WindowHeight%: Set to the Current Window's Height Variable Set Integer %x% to a random value between 0 and %WindowWidth% Variable Set Integer %y% to a random value between 0 and %WindowHeight% Mouse Move: %x%, %y% Relative to Current Window Mouse Left Click Practically speaking, there may be "boundary issues" when the values of x and y are very small or large. For example, because most (all?) windows have borders that are a certain number of pixels wide, clicking the border may have unanticipated effects.
  11. Maybe. MEP includes this test: If Macro "XYZ" is enabled If XYZ is enabled just before you run it (and disabled after it has run), then you might be able kludge together something.
  12. Variable Set Integer %x% to a random value between 0 and 500 Variable Set Integer %y% to a random value between 0 and 500 Mouse Move: %x%, %y% Relative to Current Window Mouse Left Click
  13. This question got me thinking... so I experimented a little (with Macro Express Pro)... The script runs significantly faster when testing the content of a variable instead of the clipboard. To shorten the code, you could write a separate macro to perform the test, and insert it as a "Macro Run" statement as often as needed in the main script.
  14. Your code is clear and readable. Macro Express is not a full-featured programming language, so lacks ways to do many tasks that are handled more easily and elegantly by other tools. There may be clever ways to accomplish what you are trying to achieve using MEP, but there is nothing wrong with how you are doing it. The script may run a little faster if you test a variable instead of the clipboard: T1 = Clipboard If T1 Contains 1 or If T1 Contains 2 etc.
  15. It should be... <Control>f not <Control>F The latter is equivalent to: <Control><Shift>f ... which will NOT start the "Find" command in IE.
  16. You may be sending incorrect key sequences. For example, if you want Ctrl + f, use this: <CONTROL>f Not this (which is equivalent to Ctrl + Shift + f): <CONTROL>F In other words, case matters. You may need timed delays between steps. You might also find it helpful to know about a certain feature in IE and Firefox. Pressing F7 toggles "Caret Browsing." It may be easier to navigate and select text in this mode, as it exposes a cursor that responds to directional keys such as like Shift + right (select one character to the right), Shift + End (select to the end of the line), and Shift + Ctrl + End (select to the end of the page),
  17. http://www.cantoraccess.com/publications/speech_2008_resna_macroexpress_natspeak.shtml http://www.cantoraccess.com/publications/speech_2008_csun_voice_enable_web_app.shtml
  18. I wonder whether you would have better luck if you appended the copied text to a variable, did the manipulations in variable-space, and in the final stage, transfer the content of the variable to the clipboard.
  19. If you are able to get the handle feature to work, please post a code sample. I tried and tried...
  20. I can replicate the problem. I also tested with three Text Type statements, and the same thing happened: all three strings ended up in the clipboard. All can be commented out, but all Text Type strings wind up in the Clipboard. I also tried emptying the clipboard before running. Same thing. Nice catch!
  21. If AHK scripts recognize window titles, why not use AHK for everything? One of the things I like about MEP is the ease of creating macros activated by window titles. I am reasonably familiar with AHK, and tried developing AHK scripts triggered by window titles. I poured through the Help system, posted questions on the AHK forum, and still have no idea how to do it.
  22. I find window title activation in MEP is iffy. It tends to be most reliable when windows gain focus, and less reliable when windows open or close. When it does work, there can be long delays before the command is activated. I think the feature worked better in ME3. I don't know a solution. I suspect conflicts with other software may be a factor... still testing that theory!
  23. Variable Set String %WindowTitle% to topmost window title // Get window title // You may want to parse the window title, e.g., like this: Variable Modify String: Replace " - Mozilla Firefox" in %WindowTitle% with "" Switch( %WindowTitle% ) Case: 222 Macro Run: Test1 End Case Case: 333 Macro Run: Test2 End Case Default Case Text Box Display: Window title = 222 or 333 not found! End Case End Switch Or something like this, which may be harder to follow but may be more familiar, as it uses nested IF... ELSE instead of the SWITCH... CASE statements. Variable Set String %WinTitle% to topmost program name If Variable %WinTitle% Contains "222" Macro Run: Test1 Else If Variable %WinTitle% Contains "333" Macro Run: Test2 Else Text Box Display: Window title = 222 or 333 not found! End If End If
  24. Use this code with caution. "Repeat Until <condition>" may cause a freeze if, for some reason, the condition is never met, e.g., another window steals focus. Sometimes it is possible to break out of the loop, and sometimes not. I would avoid using Repeat Until <condition> unless you can include a failsafe mechanism, e.g., a counter that breaks out of the repeat loop after, say, 1000 iterations.
  25. Macro Express Pro supports error trapping, including the ability to perform an action when a command times out. It would be easier to accomplish what you want to do with MEP.
×
×
  • Create New...