Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,532
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by acantor

  1. Oops, I didn't test by specifying an area of the screen. I tested by clicking on toolbars, maximize buttons, etc. In those cases, you can't use the left or right mouse buttons. Thanks for pointing this out!
  2. Hi Cory, I look forward to what you discover. "System Event" activation hasn't been on my radar, until now.
  3. Although you resolved the problem by choosing hotkey activation, I was curious what could be done using rberq's idea of catching an error to distinguish between a single and double click. The task appears to be doable in Macro Express, but only if you recruit the middle button instead of the left or the right button. Furthermore, the click must be directed to either specific screen coordinates, or to one of eight parts of a window, including vertical scroll bar, system tray, minimize icon, and maximize icon. This script, triggered by clicking the middle mouse button on a Maximize icon, performs one action if you click once, and a different action if you click twice. Wait for Middle Mouse Click // Catch error if second click does not happen within 1 second On Error Catch Error: Condition was not met within the specified amount of time Text Box Display: Middle button clicked ONCE on Maximize icon End Catch Error End Error Text Box Display: Middle button clicked TWICE on Maximize icon <WAIT FOR MIDDLE MOUSE CLICK Indefinite="FALSE" Hours="0" Minutes="0" Seconds="1" _HANDLE="0x0014" _COMMENT="Catch error if second click does not happen within 1 second"/> <ON ERROR/> <CATCH ERROR Code="20"/> <TEXT BOX DISPLAY Title="Middle button clicked ONCE on Maximize icon" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs14 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <END CATCH ERROR/> <END ERROR/> <TEXT BOX DISPLAY Title="Middle button clicked TWICE on Maximize icon" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs14 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
  4. I don't think you can activate a macro by double clicking. To discover what options are available using the mouse, create a new macro, and choose "Mouse Event" as activation.
  5. 1. Move the mouse to the starting position. 2. Activate the following script. 3. Move the mouse to the ending position. 4. Wait ten seconds... or to make the magic happen sooner, press Esc... The macro drags whatever is under the mouse at the starting position to the the ending position. Variable Set Integer %DwellPeriod% to 5 // Dwell time (seconds) Variable Set Integer %WiggleDistance% to 4 // Wiggle distance (pixels) Variable Set Integer %WiggleDelay% to 20 // Wiggle delay (milliseconds) Variable Set Integer %StartX%: Set to the Mouse X Coordinate // Get starting coordinates Variable Set Integer %StartY%: Set to the Mouse Y Coordinate Repeat Start (Repeat 5 times) // Signal activity by wiggling the mouse pointer... Mouse Move: %WiggleDistance%, 0 Relative to Last Position Delay: %WiggleDelay% milliseconds Mouse Move: 0, %WiggleDistance% Relative to Last Position Delay: %WiggleDelay% milliseconds Mouse Move: -%WiggleDistance%, 0 Relative to Last Position Delay: %WiggleDelay% milliseconds Mouse Move: 0, -%WiggleDistance% Relative to Last Position Delay: %WiggleDelay% milliseconds End Repeat Wait for Key Press: ESC Variable Set Integer %EndX%: Set to the Mouse X Coordinate // Get ending coordinates Variable Set Integer %EndY%: Set to the Mouse Y Coordinate If Variable %StartX% Does not Equal "%EndX%" // If mouse pointer has been moved... OR If Variable %StartY% Does not Equal "%EndY%" Mouse Move: %StartX%, %StartY% Relative to Screen Mouse Left Button Down Mouse Move: %EndX%, %EndY% Relative to Screen Delay: 500 milliseconds Mouse Left Button Up Else Beep Text Box Display: Timed out! Delay: 3 seconds End If <VARIABLE SET INTEGER Option="\x00" Destination="%DwellPeriod%" Value="5" _COMMENT="Dwell time (seconds)"/> <VARIABLE SET INTEGER Option="\x00" Destination="%WiggleDistance%" Value="4" _COMMENT="Wiggle distance (pixels)"/> <VARIABLE SET INTEGER Option="\x00" Destination="%WiggleDelay%" Value="20" _COMMENT="Wiggle delay (milliseconds)"/> <COMMENT _BACK="0080FFFF"/> <VARIABLE SET INTEGER Option="\x02" Destination="%StartX%" _COMMENT="Get starting coordinates"/> <VARIABLE SET INTEGER Option="\x03" Destination="%StartY%"/> <COMMENT _BACK="0080FFFF"/> <REPEAT START Start="1" Step="1" Count="5" Save="FALSE" _COMMENT="Signal activity by wiggling the mouse pointer..."/> <MOUSE MOVE Option="\x03" X="%WiggleDistance%" Y="0" _PROMPT="0x000A"/> <DELAY Flags="\x02" Time="%WiggleDelay%"/> <MOUSE MOVE Option="\x03" X="0" Y="%WiggleDistance%" _PROMPT="0x000A"/> <DELAY Flags="\x02" Time="%WiggleDelay%"/> <MOUSE MOVE Option="\x03" X="-%WiggleDistance%" Y="0" _PROMPT="0x000A"/> <DELAY Flags="\x02" Time="%WiggleDelay%"/> <MOUSE MOVE Option="\x03" X="0" Y="-%WiggleDistance%" _PROMPT="0x000A"/> <DELAY Flags="\x02" Time="%WiggleDelay%"/> <END REPEAT/> <COMMENT _BACK="0080FFFF"/> <WAIT FOR KEY PRESS Key="ESC" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="10" _HANDLE="0x0014"/> <COMMENT _BACK="0080FFFF"/> <VARIABLE SET INTEGER Option="\x02" Destination="%EndX%" _COMMENT="Get ending coordinates"/> <VARIABLE SET INTEGER Option="\x03" Destination="%EndY%"/> <COMMENT _BACK="0080FFFF"/> <IF VARIABLE Variable="%StartX%" Condition="\x01" Value="%EndX%" IgnoreCase="FALSE" _COMMENT="If mouse pointer has been moved..."/> <OR/> <IF VARIABLE Variable="%StartY%" Condition="\x01" Value="%EndY%" IgnoreCase="FALSE"/> <MOUSE MOVE Option="\x01" X="%StartX%" Y="%StartY%" _PROMPT="0x000A"/> <MOUSE LEFT BUTTON DOWN/> <MOUSE MOVE Option="\x01" X="%EndX%" Y="%EndY%" _PROMPT="0x000A"/> <DELAY Flags="\x02" Time="500"/> <MOUSE LEFT BUTTON UP/> <ELSE/> <BEEP/> <TEXT BOX DISPLAY Title="Timed out!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang4105{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 \r\n\\par }\r\n" Left="7" Top="1" Width="114" Height="29" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x01" Delay="3"/> <DELAY Flags="\x01" Time="3"/> <END IF/>
  6. If you kill all of the Macro Express processes via the Task Manager, and then double-click the sample macro file, the macro file will load, and it should be the only macro file that is available. Are you able to open the Editor when the sample macro file is the only running macro file?
  7. If uninstalling and reinstalling Macro Express doesn't solve the problem, I suggest contacting Insight Software. But first, see if you can create a new macro file. Perhaps there's a problem with the existing one. Or try opening one of the older backup .mex files that Macro Express automatically generates.
  8. Cory's Excel hotkeys are the same ones I use to automate spreadsheet tasks via Macro Express. Think of the Macro Recorder as a tasty appetizer, but nutritionally empty. When I teach sessions on Macro Express, I mention the Recorder but the topic is never a course objective. Although it's possible to produce working macros viathe Recorder, the scripts are likely to be very fragile, especially when capturing mouse actions.
  9. Cory's solution sounds very workable. If you know the exact number of lines the text file contains, something like this might work well enough. But Cory's solution is better. Variable Set Integer %RandomValue% to a random value between 1 and 200 Variable Modify Integer: %RandomValue% = %RandomValue% - 1 Text Type (Simulate Keystrokes): <CONTROL><HOME> // Go to top of text file Repeat with Variable: Repeat %RandomValue% times // Go down %RandomValue% lines Text Type (Simulate Keystrokes): <ARROW DOWN> End Repeat Text Type (Simulate Keystrokes): <HOME><SHIFT><END> // Select the entire line Clipboard Copy Variable Set String %T1% from the clipboard contents Text Type (Simulate Keystrokes): <HOME> // Deselect to start of line
  10. You might receive better advice by posting your question on a VBA forum rather than a Macro Express forum. There may be a way to do what you want to accomplish with Macro Express, but the Macro Express script won't be as pretty as a VBA script.
  11. It's worthwhile exploring settings in the newer versions of Macro Express. You might discover interesting features. The changes I made to the "Appearance" tab, for example, made the interface clearer and cleaner.
  12. Since you are using Shortkey macros, go to Macro Express > Options > Preferences.... > Activations > Shortkeys Are your Prefix, Suffix, and Case Sensitivity settings right?
  13. rberq, you've posted about 1,100 times to this forum. I look forward to reading your refreshingly helpful and instructive messages. If only one post was "bad", your record is still enviable: 99.9% good!
  14. Keyboard Repeat Delay Factor 1 Keyboard Repeat Speed Factor 31 Keystroke Speed: 100 milliseconds Hopefully one or a combination of the above commands will work. You'll need to experiment with different values. The "Use the clipboard and paste text" option works nicely for me. Check that there are no additional characters in the "Keystroke" field, especially invisible ones, like spaces and Enters.
  15. Variable Set String %Title% to topmost window title MessageBox: Title bar is... <VARIABLE SET STRING Option="\x05" Destination="%Title%"/> <MESSAGEBOX Caption="Title bar is..." Message="%Title%" Icon="2"/>
  16. Oh... you're referring to the list of hotkeys, not, as I erroneously thought, to the list of activation methods! You probably know this, Terry, but there are two methods for choosing a hotkey: 1. Scroll through the long list and click on the hotkey you want to use; or 2. Click in the input box, and then press the hotkey you want. I rely on the second method because it doesn't involve scrolling. (As a mostly non-mouse user, I have no patience for scrolling.) Also, I generally know which hotkey I want to assign when I start writing a macro, so the approach works for my style. I take back my suggestion to create a pop-up menu macro!
  17. My guess is that the order of the radio buttons is based on frequency of use. The vast majority of my macros are activated by hotkey or Shortkey, so the default order works brilliantly for me. Hotkey is the default activation, and can be switched to Shortkey by pressing the down arrow key, or "S." So not too much work. I use other activations only rarely. A few I've never used! If the order isn't right, how about a window-specific Pop-Up macro for the "Create New Macro" screen?
  18. It would seem that none of us -- or at least not many of us -- have taken the Windows 11 plunge. I won't be switching to Windows 11 until an application I rely on every day (Dragon Professional) is fully compatible with the new operating system. A Dragon update is long overdue.
  19. The system requirements for running Macro Express, according to this page... https://www.macros.com/sysreq.htm ...include this: Windows 11, 10, 8.1, 8, 7 or Vista Windows Server 2022, 2019, 2016, 2012 or 2008 (64 bit and 32 bit versions)
  20. I've written Macro Express scripts that can select a certain radio button. They're clunky, but they can sometimes be made to work reliably. The approach I take is something like this: 1. Navigate to the radio button control by whatever means necessary. The messiest method that has worked reliably has to been to identify a "neutral" zone on the screen, usually (but not always) near the top-left corner of the window. Clicking in the neutral zone resets the tab order for the page. Then output a series of Tabs or Shift + Tabs to reach the set of radio buttons. (This method doesn't not work on all web pages.) Another method is to search for unique text on the page and cancel the search. That sometimes moves focus to the found text. Then Tab (or Shift + Tab) to the set of radio buttons. 2. Use the Up or Down arrow key to navigate to the radio button you want.
  21. The logic looks like it should work. You're making good headway with Macro Express! I've always used the numeric value rather than the hex value when checking pixel colours, so I don't know that's the source of the problem. I would do it like this: Get Pixel Color at (1577, 961) Relative to Screen into %Healthlevel% If Variable %Healthlevel% Does not Equal "756951" etc. To debug your script, consider moving the mouse cursor to the pixel you're checking. This will help you confirm the pointer is exactly over the correct pixel: Mouse Move: 1577, 961 Relative to Screen Get Pixel Color from Beneath the Mouse into %Healthlevel% If Variable %Healthlevel% Does not Equal "756951" etc. Once you get your macro working, you can revert back to your original method, if you want. Cory is right: some applications prevent other applications, such as Macro Express, from interacting with them. If you discover that's your situation, the task you're wanting to automate will be much harder, and maybe impossible!
  22. Here is a hack that might allow you to get this done with Macro Express: You have two WebEx windows, "1" and "2." Use a macro to resize the windows. For example, make "1" 1000 x 1000 pixels, and make "2" 999 x 999 pixels. Enumerate the windows, and test the dimensions of each. If window width < 1000, do this. If window width >=1000, do something else.
  23. Hi Cory, I'm coming to the same conclusion. I had hoped the Macro Express External Script feature would make it possible to interact programmatically with applications like Word, as one can do with AutoHotkey. It would appear we Macro Express users must use indirect methods to trigger Word commands. At least we can do that!
  24. I agree with Cory. Macro Express is unique. There's not much like it. Maybe there's nothing like it. I don't think of the Macro Express "language" as simple. One of strengths of Macro Express is that its user interface is relatively straightforward, which contributes toward its ease-of-use.
×
×
  • Create New...