Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,532
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. 1. Add delays between the steps to try to isolate the problem. 2. Or use an alternative way to navigate to the "Find What" field, perhaps something like this: Ctrl + r ' Invoke Replace dialog Wait 500 ms Alt + c ' Landmark on the "Match Case" checkbox Alt + c ' Restore the original value Wait 500 Type "c:\docs" Etc. 3. Use controls to navigate to and around the fields and buttons.
  2. Here is another (untested) way to trigger VBA macros in Excel via Macro Express. Let's say the Excel macro is called "Testing123" Text Type (Simulate Keystrokes): <ALT><F8> // Activate the Macro dialog box Delay: 200 milliseconds Text Type (Simulate Keystrokes): Testing123 // Type the macro name Text Type (Simulate Keystrokes): <ENTER> // Activate the macro
  3. That's bad news. I chose the Classic theme in XP, Vista, and Win 7. I find Aero themes harder to read because of suboptimal colour contrasts. And animated effects bore me; the novelty wears off quickly. Microsoft software products are looking more and more cartoonish!
  4. Although not the most reliable method, it is more reliable than positioning the mouse/clicking. So it's a good technique. There are refinements to the technique, e.g., in Firefox, the forward slash / initiates a search of hypertext links only. I have never used Ctrl + Enter to activate a hypertext link. Enter works for me. Hopefully others will chime in on programmatic approaches to activating web controls, which are inherently more reliable than manipulating the user interface.
  5. There is rarely a reason for a macro to activate an icon in the Notification Area / System Tray. Is there an executable that will accomplish the same thing? If yes, then you can do this with Macro Express: Program Launch: "ABC.EXE" (Normal) ...in which you specify the program and its path as... C:\Program Files (x86)\Oracle\JavaFX 2.1 Runtime\bin\plugin2\ABC.EXE This more programmatic approach gets around knowing what is on the System Tray and where it appears in the System Tray. There is also no need to position the mouse, because the command line accesses a file directly.
  6. Something like this, perhaps? // SECTION 1 // T1 is the title bar for the current window. // This section is designed to help you work out title bar text that shows Gmail is running in Chrome. // Delete Section 1 after you have figured out a value for T2 Variable Set String %T1% to topmost window title Text Box Display: Title bar of current window = %T1% Macro Stop // SECTION 2 // T2 is the title bar fragment that indicates Gmail is running in Chrome. // (I don't use Gmail or Chrome, so I cannot work it out for you! ) Variable Set String %T2% to "Gmail - Google Chrome" If Window "%T2%" is running Window Activate: Gmail - Google Chrome Else Web Site, "http://gmail.com",using Default Web Browser End If
  7. The default hotkey for jumping to the next tabbed window is Ctrl + Tab. To the previous tab, Shift + Ctrl + Tab. I'm not sure you can use the web site command to choose a particular tabbed window.
  8. Another approach is to check the pixel colour at (x, y) rather than under the mouse pointer: // Check every pixel along a horizontal path from (100, 200) to (400, 200) // Variable Set Integer %x% to 100 Variable Set Integer %y% to 200 Repeat Start (Repeat 300 times) Get Pixel Color at (%x%, %y%) Relative to Current Window into %PixelColour% If Variable %PixelColour% Equals "123456" Text Box Display: Pixel colour found at %x%, %y% Macro Stop Else Variable Modify Integer %x%: Increment End If End Repeat Text Box Display: Pixel colour was not found This method runs faster, although I haven't tried it in Windows 10. While debugging these scripts, I usually include a mouse move command in the loop just to ensure the math is right, and then comment it out or delete it after the macro is working.
  9. Try navigating to static text or a hypertext link near the search box, and then Tab or Shift Tab to it. Something like this: Type CONTROL + f Wait 250 milliseconds Type Surname{ENTER} Wait 250 milliseconds Type ESC Wait 250 milliseconds Type SHIFT+TAB SHIFT+TAB SHIFT+TAB SHIFT+TAB
  10. Are you able to find the "tk" on the list when you click the "Browse" button in the Window Activate dialog box? If the name does not appear on the list, it is invisible to Macro Express.
  11. The condition that must be met is that the window title you specify matches, in whole or in part, the title of the window you want brought to the fore. Hint: the window title is often in this format: XXXX - YYYY E.g., Macro Express Pro - Explorer Document1 - Microsoft Word Moving mouse to window of running program - Macro Express Pro - Macro Express Forums - Mozilla Firefox Note the pattern at the end of each line is space hyphen space ProgramName So if you specify a partial match, do this: For Macro Express's Explorer: - Explorer For Microsoft Word documents: - Microsoft Word For Firefox: - Mozilla Firefox Check out the Help screen for Window Activate. Macro Express help screens are excellent... much better than most applications.
  12. I see the same issue, although it's intermittent, and does work 90% or 95% or more of the time. Because it's mostly reliable I'm not bothered. Do you have both of the checkboxes checked: "Always on Top" and "Keep Focus?"
  13. Something like this? Use the "Mouse Locator" to identify the x y position in the target window.If I understand correctly, you want to position the mouse relative to a different window than the one that is currently focused. Variable Set String %CurrentWindow% to topmost window title // Window Activate: - Target Window Delay: 500 milliseconds // A delay may or may not be needed // Mouse Move: 123, 456 Relative to Current Window // // Do what you need to do in the target window // Window Activate: %CurrentWindow%
  14. The Macro Express command that detects when an Internet Explorer page is fully loaded does not work reliably either, or at least that's been my experience. So whether I am writing a macro for IE or Firefox, I usually end up using kludges to detect loaded webpages. Here are a few rules for these kinds of kludges: 1. Avoid this kind of loop: Repeat Until %PixelColour% Equals "12345" If the pixel colour is not found, the macro is looping forever. Instead, repeat a finite number of times, and then declare failure! Repeat Start (Repeat 100 times) Get Pixel Color from Beneath the Mouse into %Pixel% If Variable %Pixel% Equals "12345" // Perform next step after pixel is found Macro Stop End If Delay: 1 seconds End Repeat Text Box Display: Pixel colour 12345 was not found! 2. Don't use a timed delay when you can use a "regular delay: Delay: 1000 milliseconds, without ability to halt Instead, use this delay: Delay: 1000 milliseconds In macros with a lot of looping, the former tends to freeze Macro Express more often than the latter. Anything else?
  15. There appears to be is a carriage return (ASCII 13) at the end of the quote. So what I would do is copy the clipboard to a text variable (T1); calculate the position of ASCII 13 in T1 (N1); copy from character 0 to character N1 in T1, and assign it to T2; and then copy T2 to the clipboard. Variable Set to ASCII Char 13 to %T[99]% // This is the Ascii code for a carriage return Variable Set String %T[1]% from the clipboard contents Variable Set Integer %N[1]% to the position of "%T[99]%" in %T[1]% Variable Modify String: Copy a substring in %T[1]%, starting at 0 and %N[1]% characters long to %T[2]% Variable Modify String: Save %T[2]% to the clipboard You will likely need to tweak the code slightly. I haven't thoroughly tested the code. Also, I did this with Macro Express Pro, so the syntax will be a little different with Macro Express 3.
  16. I have used rberq's approach, as well as the similar technique of monitoring the shape of the mouse cursor. But as Cory notes, there is no elegant solution using Macro Express. Nevertheless, kludges (like pixel sniffing or mouse cursor monitoring) can be made to work reliably. I use them all the time. But these "solutions" take time to massage toward reliability. Note: if you check pixels, the colours may change when you update Firefox, so plan accordingly! E.g.: Get Pixel Color from Beneath the Mouse into %PixelColour% // Target colour // If Variable %PixelColour% Equals "12345" // Look for "12345" in Firefox 46. Target was "12333" prior to Firefox 41. // Do something End If
  17. In some non-standard screens running under Windows, pressing Alt + spacebar may reveal program features that are otherwise difficult or impossible to access. For example, in the Windows Command Prompt, Alt + spacebar opens the System menu, which includes "Edit," which makes it possible to "Mark" a selection, and "Copy" and "Paste" it.
  18. Add a new script that is activated automatically on a schedule every five minutes:
  19. I don't think so. But you can change the appearance of the user interface, in limited ways, via Options > Preferences > Appearance > Explorer.
  20. You may not need to run the program from the Run prompt. In Windows 7, the full path is C:\Windows\System32\diskpart.exe Assuming the full path to diskpart.exe is the same in Windows 10, use Macro Express's "Program Launch," specifying the full path.
  21. Good tip! I use the same technique to display the current values of variables, or to show a script has reached a certain point. Here is a tip in return: in the Script Editor, the keyboard shortcut to disable/enable a line of code is Ctrl + N.
  22. Rename the existing four files. Then copy the files.
  23. I use the built-in display theme. The Aero theme doesn't do a thing for me... in fact, I think the Aero theme complicates access because it makes it harder to visually differentiate foreground and background windows. I appreciate that Insight is going to try to fix the flashing. Nevertheless, the mouse locator tool works.
  24. I see exactly the same flashing behaviour. I use the Windows Classic display scheme on my Windows 7 machine.
  25. Many of my Macro Express scripts rely on "pixel sniffing" to make inferences about the user interface. There are many ways to improve the reliability of these inherently unreliable scripts, e.g.,: Let's say you are checking vertically for a colour 123456 inside a window. Let's say you start searching 100 pixels from the top left edge of the window. You can set the maximum number of pixels to check this way: %N1% = height of current window // Maximum number of pixels to check %x% = 100 // Starting x coordinate %y% = 0 // Topmost y coordinate to check Repeat %N1% times %z% = pixel colour at %x%, %y% relative to window If %z% = 123456 // Done! Target found, so click on it Move Mouse to (%x%, %y%) Mouse Left Click Macro Stop End If %y% = %y% + 1 // Increment y value End Repeat MsgBox "Error! Pixel not found!"
×
×
  • Create New...