Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble Migrating AHK Scripts to QM
#1
Hello,

I'd like to start off with thanking the developers of this great application! It's finally allowed me to make some progress on this project I've been having weeks of trouble with. Background on that can be found here autoitscript.com/forum/topic/165854-first-script-woes/* and sliderdock.wikidot.com/forum/t-1057679/virtual-keystrokes-not-working* in case anyone is interested in what I'm trying to accomplish.

*Note: Can't seem to post URLs, so you'll have to add the http prefix manually.

Anyway, so far I've been able to finally get SliderDock to come up using the recorder function via mouse clicks (though I would have preferred to use low-level keystrokes, it does work...). What I'm trying to do now is migrate a work in progress AHK script that's supposed to check to see if a program called SliderDock is open, if it's not, run it from it's target location. After which, if SliderDock is running when the script/macro is initiated again, check to see if it's active, if it's not focus/activate its window and center the mouse on the first button of SliderDock.

Here's the original AHK script:

Code:
Copy      Help
IfWinNotExist, HwndWrapper[SliderDock.exe;;e10b0dd9-310e-4b17-9e43-74124f37f252]
{
    Run, "C:\Program Files (x86)\SliderDock\SliderDock.exe"
}
IfWinNotActive, SliderDock
{
    WinActivate, SliderDock
    Sleep, 333
}

What I have so far in QM:
Code:
Copy      Help
ifa- ("SliderDock")
    act ("SliderDock")
    
        
#region Recorded 12/14/2014 6:12:23 PM
rig 39 18 id(1504 win("" "Shell_TrayWnd")) 1 ;;tool bar 'User Promoted Notification ...', push button 'SliderDock'
lef 83 33 wait(15 WV win("" "WindowsForms10.Window.20808.app.0.1a6f050")) 1 ;;menu item 'show/hide'
int w = win("SliderDock")
mou 238 ym(0 w) w
#endregion
end

I get errors on the first half. And even though in the recorded region, it does show and hide SliderDock when the script is ran, when it hides it, I can't seem to get it to activate the previous window and move the mouse to the center of that previous window.

Ideally, I would like this script to stay running in the background, listening for additional low-level keyboard and mouse input since that's how this application was written. That's been my biggest hang up with Autoit and AutoHotKey, not understanding how to send that type of input to SliderDock.

Anyway, any assistance would be greatly appreciated. And I'll gladly share it with this community once everything is sorted out. Thanks! Big Grin
#2
To create QM script that does the same as this AHK script, use this dialog: floating toolbar -> Files,web -> Run program.

Quote: I can't seem to get it to activate the previous window and move the mouse to the center of that previous window
Get current window handle before clicking the tray icon. Activate it after.

int w=win
rig 39 18 id(1504 win("" "Shell_TrayWnd")) 1 ;;tool bar 'User Promoted Notification ...', push button 'SliderDock'
lef 83 33 wait(15 WV win("" "WindowsForms10.Window.20808.app.0.1a6f050")) 1 ;;menu item 'show/hide'
act w
mou 0.5 0.5 w

Quote:how to send that type of input to SliderDock
QM does not have a more low-level function to send keys. key() in QM probably works like Send() in AutoIt.


Forum Jump:


Users browsing this thread: 1 Guest(s)