Posts: 41
Threads: 11
Joined: Jul 2012
Greetings , i own 2 another macro software but im interested in quick macros , hoping it will do some thing others couldnt,
Basically, i want f2 key to close tab in firefox and this trigger will only work in firefox.
Quick search revealed that there are window filters i can use , which did work to some extent.
function# iid FILTER&f
if(wintest(f.hwnd "" "MozillaWindowClass")) ret iid ;;change window name and class
ret -2
However , when im watching videos in youtube or in some other video site, once the embedded video box is in focus, macro will not work.
Status bar of "quick macros" shows that , video box still has the "MozillaWindowClass".
This is the same problem which i encountered in other software as well , i trust i will find a solution here. Thanks in advance.
Posts: 12,086
Threads: 142
Joined: Dec 2002
On my PC the macro always works.
Firefox 14.0.1, Windows 7.
I'm using Adobe Flash Player 11.2.202. It is not the latest version, because after upgrade to a newer version it often deactivated firefox window.
Maybe the macro does not work because firefox window then is not active.
This shows what window is currently active when you press F2:
;/
function# iid FILTER&f
outw win ;;active window
outw f.hwnd ;;normally should be the same as above
if(wintest(f.hwnd "" "MozillaWindowClass")) ret iid ;;change window name and class
ret -2
After editing click Save or Compile button on toolbar.
Posts: 41
Threads: 11
Joined: Jul 2012
11.3.300 is the version of flash im using, and win7 aswell . I have tried your macro and it didnt change anything .
You may be right about flash deactivating the window . Just because of that , my macro includes clicking 0,600 only to activate window so that ctrl+w works to close tab.
However since , as you said , window is not active , f2 trigger does not work at all.
And still , these are the problems i want "quick macros" to overcome, there should be a way to both sense what window im on and make this macro work. Still waiting for suggestions.
Posts: 12,086
Threads: 142
Joined: Dec 2002
The macro probably runs, but if it uses Firefox keyboard shortcuts while Flash player is focused, they don't work.
http://superuser.com/questions/172952/f ... n-that-off
Let the macro set focus to the Firefox web content pane.
Macro
FF close tab
int w=win
Acc a.Find(w "DOCUMENT" "" "" 0x3010 2)
a.Select(1)
key Cw ;;Ctrl+W
Posts: 41
Threads: 11
Joined: Jul 2012
My last tryout was
function# iid FILTER&f
outw win ;;active window
outw f.hwnd ;;normally should be the same as above
if(wintest(f.hwnd "" "MozillaWindowClass")) ret iid ;;change window name and class
ret -2
used together with
int hwnd=val(_command)
spe 1
POINT _m; xm _m
int w=win
Acc a.Find(w "DOCUMENT" "" "" 0x3010 2)
a.Select(1)
lef 0 1000
key Cw ;;Ctrl+W
--------------------------------------
mou _m.x _m.y
It still didnt work "again it works until i click the embedded video and apparently flash hijacks keyboard triggers" And then macro does not work anymore . Im still hoping to find some solutions , i have used autohotkey for many years and created great macros. Time has come for me to move to a cleaner program and quick macros seem promising. Most important thing for me is the reliability of the macros and this flash hijacking keyboard triggers is just not cool.
Posts: 12,086
Threads: 142
Joined: Dec 2002
My macro that works:
Macro
FF close tab
Trigger
F2 /FIREFOX
out "macro 'FF close tab' started"
;set focus to firefox, because Flash player may have it, and then Ctrl+W would not work
int w=win
Acc a.Find(w "DOCUMENT" "" "" 0x3010 2)
a.Select(1)
key Cw ;;Ctrl+W
Don't need a filter function. Just set program FIREFOX, like here. But with filter function also works, tested.
Posts: 41
Threads: 11
Joined: Jul 2012
Success:
I learned quite a bit more about QM while trying to solve my problem .
Main issue was , no matter which macro or code i used , none of them worked after focusing embedded flash video object.
All of hotkey triggers became disabled until clicking somewhere else with the mouse.
I was expecting a deeper level of keyboard hook control from QM , so i started searching around and finally found this option "use low level hook-> keyboard".
Which did prevent flash from stealing keyboard hooks from everything else. And my macros started working flawlessly. :mrgreen:
I hope this will be a lasting solution for situations similar to this one. I dont want any other program to compete against QM's hooks.