Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,534
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. I still use this technique occasionally, and I can usually get it to work. Usually the script looks something like this: [ESC][ESC] // Cancel menu if accidentally open {CONTROL}f // Find... <word to find> {Enter} // Initiate search [ESC] // Cancel search Delay 200 ms // Wait for window to regain focus after search bar loses focus {Tab}
  2. Terry, Have you tried capturing controls as a way to distinguish the different parts of the user interface? Then use "click on control" or "set focus on control" to activate the part of the UI. The technique works beautifully in some applications, but not at all in others.
  3. Here is how I would explain the difference. Let's say I have created a macro to work while reading this thread, only. Because I am using Firefox, the title bar says: Activation puzzle - Macro Express Forums - Mozilla Firefox If I set the scope to Program Specific, I would need to identify the program: firefox.exe. The macro will respond whenever Firefox is running; the problem is that the it will respond in any Firefox session. If I set the scope to Window Specific, and specify the window to exactly match "Activation puzzle - Macro Express Forums - Mozilla Firefox," the macro is available only in this thread, and only in Firefox. (If I tried with Internet Explorer, the macro would NOT be available because the window title would be different, i.e., "Activation puzzle - Macro Express Forums - Internet Explorer." If I want the macro to work in both Firefox and Internet Explorer, I would set the scope to Window Specific, partial match: "Activation puzzle - Macro Express Forums" (or perhaps "Activation puzzle"). I hope this helps.
  4. I set the scope of my macros to window- or program-specific as needed. I have not noticed one being more or less reliable than the other. Have you experimented with settings such as "wait for Hotkey to be released" (Activation) and "a window with this title must be on top" (Scope)? I haven't had great success when the window title contains a wildcard, but YMMV. Can you reproduce the problem if you leave the scope as window specific, but you change the activation from Shift + T to a function key? Is the macro actually activated when you press Shift + T? (Little man running in SysTray.) If yes, try adding an initial statement that activates the application or window.
  5. Mouse positioning is a very unreliable way to complete a form. A more machine- and browser-independent approach would be to navigate from one field to another via the tab key, maybe something like this: ' Place cursor in first field (maybe use the mouse?) ' Navigate to Field 1... Text Type <TAB> ' Copy value to the Clipboard (field will be selected by default) Text Type <CTRL>c ' Copy the Clipboard to variable T1 Set Text Variable T1 from Clipboard ' Navigate to next field... Text Type <TAB> Text Type <CTRL>c Set Text Variable T2 from Clipboard etc.
  6. Congratulations on finding a workaround. Your solution is about as elegant as you are likely to get using Macro Express. Every scripting language has strengths and limitations. Exploiting the strengths and working within the limitations takes skill, which only comes with time and practice.
  7. It would be helpful to know (1) what the macro is supposed to do; and (2) why you think it needs shortening. In many cases, clarity trumps brevity! (Or instead of being "clear," it may be better for a script to be "reliable," "robust," "portable," and/or "maintainable..."
  8. Probably it can be done, but you will have a far easier time if you simulate keystrokes instead of mouse clicks. Ctrl space to select. Ctrl down to navigate down without selecting, but retaining selected items. For example, to select item 1, 3, and 6 from a list... Ctrl space [select 1] Ctrl down [move down to 2] Ctrl down [move down to 3] Ctrl space [select 3] Ctrl down [move down to 4] Ctrl down [move down to 5] Ctrl down [move down to 6] Ctrl space [select 6]
  9. I do not believe the scripts are backward compatible. You may need to recreate them from scratch. I was thinking that it might be possible to replace Version 4 variable names with Version 3 variable names, and then export. (E.g., %Count% becomes %N1%.) But I don't think this will work, as the structure of commands in the two versions appears to be slightly different.
  10. Yes, it can be done, but it requires clever/flaky coding. The technique I use is to search every pixel along a line, or within an area, for the colour of the selected text.
  11. It depends on the program. Some applications overlay a virtual "layer" over screen objects that prevents Macro Express from detecting colours. But these apps are rare. I have seen one, maybe two. If Macro Express can see the colours -- you can test this with the Mouse Locator -- then it is possible. There is no automatic way to search wide swaths for pixel colours in Macro Express -- I have requested this as a feature! -- but it's possible to construct a macro that checks every pixel along horizontal and/or vertical lines. If you know approximately where the colour is supposed to appear -- say, in a small zone or along a single line -- you can make a macro that executes quickly. But if you make a macro that checks every pixel on a screen, the script can take a long time to run -- probably too long for gaming purposes.
  12. I can set the size of the border like this: Windows Sizing Border: 1 pixels But is there a way to determine the size of the current border? Like this imaginary command... Variable Set Integer %BorderInPixels%: Set to a Border Thickness (%ThisWindow%)
  13. // Method 1 - Use a variable to capture the window title Variable Set String %WindowTitle% to topmost window title // Test if the focused window title contains the words "UltraEdit" If Variable %WindowTitle% Contains "UltraEdit" // Value not found. Do something. Else // Value is found. Select to end of line. Text Type (Simulate Keystrokes): <SHIFT><END> End If // Method 2 - Use the "If Window" command If Window "UltraEdit" is focused // Value not found. Do something. Else // Value is found. Select to end of line. Text Type (Simulate Keystrokes): <SHIFT><END> End If
  14. Maybe try the "PostMessage" command, which allows you to send a Windows message to any control. I've never used it. Maybe others have?
  15. If the mouse pointer cannot be moved for even 5 or 10 milliseconds, you need another approach that does not involve the mouse. Is it possible to perform the task by keyboard? If yes, then your macro will send a sequence of keystrokes rather than mess with the mouse. Alternatively, you might be able to use ME to capture information about the control you want to double-click, and then activate the control programmatically. This is probably the most elegant and reliable solution, although implementing it would not be easy for a beginner.
  16. Maybe something like this? The mouse pointer moves to the target to double click it, but only for a fraction of second. // Capture mouse position (can specify relative to the window or screen) Get Mouse Position into (%N1%, %N2%) Relative to Screen // Move mouse to target, and double click Mouse Move: 100, 200 Relative to Screen Mouse Left Double Click //Restore original mouse position Mouse Move: %N1%, %N2% Relative to Screen
  17. Download Macro Express, and try it yourself. The evaluation period is 30 days, which should be plenty of time to test whether MEP will work. For the record, I have written MEP macros to automate tasks in Craigslist, and they have always worked reliably. Copying and pasting between applications via macros is a good project for novice script-writers. Usually there are challenges, but it's do-able.
  18. Mouse movements may or may not be necessary. I usually find it sufficient to give focus to the target control, without clicking it. As usual, the decision is made case by case.
  19. I have had similar problems when sending text directly to a control. In most cases, I "solve" the problem -- it's not a solution I like -- by putting focus on the field, and then sending the text via "simulating keystrokes. I avoid <ShiftDown> and <ShiftUp>: I prefer a sequence like <HOME><SHIFT><END><DELETE>, which probably gives the same result, but I am superstitious of commands that simulate holding down a key... Alan
  20. There may be tools to do what you want to do, but I don't think Macro Express is one of them! I do use about a dozen Macro Express shortkeys to make it faster to fill out the form fields I need most often: js = John Smith pc = M4K 1X1 ph = 416-555-1234 32e = 32 Eastborough Avenue North etc.
  21. I have scripted many macros to complete forms. Each macro is unique, but usually follows this kind of logic: 1. Move the cursor to the first field. 2. Input value. 3. Press Tab (to move the cursor to the next field). 4. Input value. 5. Press Tab. etc. "Input value" might mean typing a word (e.g., a user name, password, address, or telephone number); checking or unchecking a check box (press the spacebar); choosing an item from a drop down list (there are different ways to do this depending on the form), and so on.
  22. Confirming the bug. I am getting the same result. The variable is not evaluated, but appears literally.
  23. I have Macro Express Pro installed on a Vista and Windows 7 machine, and have not experienced problems recently. There were problems when MEP was first issued, but everything runs smoothly for me now, and has for the previous two or three releases. I remember a few hiccups when MEP updated my ME3 scripts, but almost all translated properly. Some scripts triggered by window events required minor adjustments. But the transition was relatively painless, and overall, I have come to prefer MEP. On occasion, a script that uses <ALTD> or <ALTU> causes the Alt key to get stuck in the down position. In these cases, MEP has to be restarted. But the same thing happens with some of my AutoHotkey scripts. I am not sure about the disappearing macros and categories. It's never happened to me, and I have hundreds of scripts organized into 70 + categories. I am curious what you have done to resolve the problem. Did you uninstall and reinstall MEP? Are you running ME3 at the same time as MEP? Did you test if MEP is conflicting with other programs that monitor keyboard activity? (For example, I have seen Macro Express clash with two different screen reading applications, JAWS and Window-Eyes, although in entirely different ways.) I hope you are able to get to the bottom of this!
  24. To determine whether today is the last day of the month, you need a macro something like this (in pseudo-code): // %T1% is today's month in <num><num> format, e.g., February = 02 // %T2% is the number of days in the month Today's month = %T1% // If January, March, May, etc. If %T1% = "01" OR %T1% = "03" %T1% = "05" etc. %T2% = "31" // If April, June, etc. If %T1% = "04" OR %T1% = "06" etc. %T2% = "30" // Else it's February. (Need a special case for leap years) Else %T2% = "28"
×
×
  • Create New...