Jump to content
Macro Express Forums

acantor

Members
  • Posts

    1,193
  • Joined

  • Last visited

  • Days Won

    9

acantor last won the day on May 18

acantor had the most liked content!

1 Follower

Contact Methods

  • Website URL
    www.cantoraccess.com
  • ICQ
    0

Profile Information

  • Location
    Toronto

Recent Profile Visitors

846 profile views

acantor's Achievements

  1. (Image of a deer caught in a headlight!) I confess... I do this occasionally... but only when the speed penalty is too great. I do for myself, but not for the macros I write for others. I know how to break out of an infinite loop, but my clients usually don't!
  2. The problem I've had with UNTIL loops is the ease of getting into infinite loops. The workaround I use is to set a "failsafe" value for the maximum number of repeats. Sometimes this value is a guess -- e.g., 20 or 100 or 1000 should be enough -- and sometimes it's calculated -- e.g., the number of pixels between points A and B. It's less efficient to introduce and keep track of a failsafe variable, but I find the technique leads to more reliable scripts.
  3. Copying the file to the old to the new computer should work fine. You'll need to reinstall Macro Express on the new PC.
  4. You could write a macro, using Macro Express, that would perform the three steps to navigate to the dialog box via hotkey. Alt + F Slight pause O
  5. I'm running a test macro. So far, the script has activated at the correct time. With another macro scripting tool that I use, there's a bug related to time: it gets converted to Greenwich Mean Time!
  6. While there are programs that Macro Express cannot detect – Adobe Reader is hit-and-miss – programs that are easily controllable via keyboard using normal interaction rules are, in my experience, very amenable to macro automation. But Q-Dir appears to be an exception. I don't think I've ever seen anything quite like the difficulties we are seeing in accessing different areas of Q-Dir's interface via macros when Q-Dir already has a reliable set of hotkeys. Workarounds are not necessarily a bad thing. In my macro-scripting world, I often need to puzzle out workarounds to gain the functionality I'm after.
  7. I just tried this AutoHotkey script: !1:: SendInput, ^1 return Translation: Create a hotkey triggered by Alt +1 that outputs Ctrl + 1 I tested the macro in Q-Dir, and it fails. When I run the macro in Word, the command works. (Ctrl + 1 in Word = single space the paragraph.) So the problem is not inherent to Macro Express. My script fails as an AutoHotkey macro, which is a more powerful automation tool than Macro Express -- albeit much harder to learn and use... which is why MEP is still my first choice.
  8. Here's another workaround: two scripts: one that navigates to the next pane, and the other to navigate to the previous pane. Macro 1: Text Type (Simulate Keystrokes): <ALT>d Text Type (Simulate Keystrokes): <TAB> Macro 2: Text Type (Simulate Keystrokes): <ALT>d Text Type (Simulate Keystrokes): <SHIFT><TAB> So if the third pane has focus and you want to go to the first, press the hotkey for the first macro twice, or the second macro three times.
  9. This was all sounding curious, so I downloaded the software, installed it, and wrote a few macros. You're right, my scripts don't seem to be able to send Ctrl +1, 2, etc. to the application. However, I found a workaround. Rather than send keystrokes, I could capture the controls for all four address bars, and gain access to the "panes" that way. Get Control: (Q-DIR.EXE) Using z-order -> %Control% Set Focus to %Control% When you use Macro Express's Get Control feature, you'll need to drag the crosshairs (a stylized purple-coloured "X") over each of the four address bars. I used the option to capture using each control's "Z-order."
  10. If moving the mouse to the text cursor position doesn't work (followed by space or Ctrl + space... or by Up arrow then Down arrow... or Down arrow then Up arrow.... Then the best option is probably what Cory suggested right off the bat: checking pixel colours. Pixel checking under Windows 7 and earlier worked beautifully. They are slow under Windows 10, and therefore, I've been forced to change the way I hunt for colours. I used to check each pixel along a path; now I check every 20th, or 50th, or 100th. Looking at your screen shot, I'm guessing you could get away with checking every 50 pixels, which will likely be fast enough. Maybe something like this untested code: // Calculate half horizontal size of window Variable Set Integer %WinWidth%: Set to the Current Window's Width Variable Modify Integer: %WinWidthHalf% = %WinWidth% / 2 // Maximum times to check for a pixel colour Variable Set Integer %MaxChecks% to 25 // Y-coordinate fudge factor -- where to start checking pixel colours from top of window Variable Set Integer %y% to 200 Repeat Start (Repeat %MaxChecks% times) Mouse Move: %WinWidthHalf%, %y% Relative to Current Window Get Pixel Color from Beneath the Mouse into %PixelColour% If Variable %PixelColour% Equals "123456" // Colour of a selected row Mouse Left Double Click Macro Stop Else Variable Modify Integer: %y% = %y% + 50 // Next time, check 50 pixels "south" End If End Repeat Text Box Display: Pixel colour not found! <COMMENT Value="Calculate half horizontal size of window"/> <VARIABLE SET INTEGER Option="\x0A" Destination="%WinWidth%"/> <VARIABLE MODIFY INTEGER Option="\x03" Destination="%WinWidthHalf%" Value1="%WinWidth%" Value2="2"/> <COMMENT/> <COMMENT Value="Maximum times to check for a pixel colour"/> <VARIABLE SET INTEGER Option="\x00" Destination="%MaxChecks%" Value="25"/> <COMMENT/> <COMMENT Value="Y-coordinate fudge factor -- where to start checking pixel colours from top of window"/> <VARIABLE SET INTEGER Option="\x00" Destination="%y%" Value="200"/> <COMMENT/> <REPEAT START Start="1" Step="1" Count="%MaxChecks%" Save="FALSE"/> <MOUSE MOVE Option="\x02" X="%WinWidthHalf%" Y="%y%" _PROMPT="0x000A"/> <GET PIXEL COLOR Option="\x00" Rel_To_Screen="TRUE" Destination="%PixelColour%"/> <IF VARIABLE Variable="%PixelColour%" Condition="\x00" Value="123456" IgnoreCase="FALSE" _COMMENT="Colour of a selected row"/> <MOUSE LEFT DOUBLE CLICK/> <MACRO STOP/> <ELSE/> <VARIABLE MODIFY INTEGER Option="\x00" Destination="%y%" Value1="%y%" Value2="50" _COMMENT="Next time, check 50 pixels \"south\""/> <END IF/> <END REPEAT/> <COMMENT/> <TEXT BOX DISPLAY Title="Pixel colour not found!" 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"/>
  11. In many applications, a hotkey moves focus to the address line without the need to know its coordinates. Try Alt + D and/or Ctrl + L.
  12. I think this solution might only work when the mouse pointer happens to be hovering over the row. I don't know this application, but few programs I've seen move the mouse pointer when navigating via arrow keys.
  13. So... you manually click inside Q-DIr before you press the hotkey, and sometimes it works, sometimes it doesn't. Any patterns you can discern to the failures, e.g., the hotkey never works the first time you press it, but it always works the second time. If this is the case, not sure what is going on, although it might have to do with a component of Q-Dir stealing focus. Take a screen shot of Q-Dir window, and post it here!
  14. What happens if you manually click somewhere inside the application window before activating the hotkey?
  15. 1. Try substituting this: <TEXT TYPE Action="0" Text="<CTRL>1"/> 2. What happens if you change the activation to something that doesn't involve a modifier key, e.g., F11, F12, Numpad *, etc.
×
×
  • Create New...