I use Opera browser, but if I write something like this:
Code: Select all
#IfWinExist, ahk_exe opera.exe
F::F11
Thanks in advance!
Code: Select all
#IfWinExist, ahk_exe opera.exe
F::F11
Code: Select all
SetTitleMatchMode, 2
#If WinActive("YouTube - Opera ahk_exe opera.exe")
F::F11
It doesn't work. I'm not sure if this matters but the title of the tab doesn't start with "YouTube -"teadrinker wrote:Hi, jack3333,
Try:Code: Select all
SetTitleMatchMode, 2 #If WinActive("YouTube - Opera ahk_exe opera.exe") F::F11
In that case try this:jack3333 wrote:It's at the end: *video title* - YouTube
Code: Select all
SetTitleMatchMode, 2
#If WinActive("- YouTube ahk_exe opera.exe")
F::F11
Still doesn't work. The thing is that the F key is the default YouTube fullscreen, but when you enter fullscreen like this, you can't scroll down the site.teadrinker wrote:In that case try this:jack3333 wrote:It's at the end: *video title* - YouTubeCode: Select all
SetTitleMatchMode, 2 #If WinActive("- YouTube ahk_exe opera.exe") F::F11
Code: Select all
#IfWinExist, ahk_exe opera.exe
f::F11
Yes, SetTitleMatchMode, 2 must be at the beginning of the script.Exaskryz wrote:Have you set this command into your auto-execute section?
Exaskryz wrote:To be clear, what is your full code?
teadrinker is using the SetTitleMatchMode command. Have you set this command into your auto-execute section? If you have not, that can explain the problems. Use the Window Spy which can be accessed by right-clicking the tray icon (by the system clock) of a running script to verify the window title.
This:teadrinker wrote:Yes, SetTitleMatchMode, 2 must be at the beginning of the script.Exaskryz wrote:Have you set this command into your auto-execute section?
Code: Select all
SetTitleMatchMode, 2
#If WinActive("- YouTube ahk_exe opera.exe")
f::F11
Code: Select all
#IfWinExist, ahk_exe opera.exe
f::F11
*Title of the video I'm watching* - YouTube - Operateadrinker wrote:What window title does Window Spy show?
Code: Select all
SetTitleMatchMode, 2
#If WinActive("- YouTube - Opera")
f::F11
Code: Select all
SetTitleMatchMode, 2
#IfWinActive, - YouTube - Opera
f::F11
Exaskryz wrote:Try this:
Or since the #IfWinExist worked for you, we can try #IfWinActive,Code: Select all
SetTitleMatchMode, 2 #If WinActive("- YouTube - Opera") f::F11
I figure at this point if the window title includes - Opera we don't need to worry about the ahk_exe opera.exe part.Code: Select all
SetTitleMatchMode, 2 #IfWinActive, - YouTube - Opera f::F11
Code: Select all
SetTitleMatchMode, Regex
#IfWinActive, .* - YouTube - Opera
f::F11
I thought that one was really going to work, but it didn't.teadrinker wrote:Try:Code: Select all
SetTitleMatchMode, Regex #IfWinActive, .* - YouTube - Opera f::F11
Code: Select all
SetTitleMatchMode, 2
#IfWinActive YouTube
f::MsgBox hello
It works! Wait, I was suppose to always use a new script?Exaskryz wrote:Try just this in its own separate script. This should work and I have no reason to doubt it:
We can start there. If the MsgBox appears, we can replace it with f::F11. If it doesn't, something wonky is going on.Code: Select all
SetTitleMatchMode, 2 #IfWinActive YouTube f::MsgBox hello
teadrinker wrote:Yes, SetTitleMatchMode, 2 must be at the beginning of the script.Exaskryz wrote:Have you set this command into your auto-execute section?
Damn it. Thought it meant something else.teadrinker wrote:teadrinker wrote:Yes, SetTitleMatchMode, 2 must be at the beginning of the script.Exaskryz wrote:Have you set this command into your auto-execute section?
I don't think that it is possible. AHK can't recognize, which element of Opera window is active.Is it possible to disable this when I'm typing in the YouTube search box?
Code: Select all
f::Send {F11}
Code: Select all
!space::
Hotkey, space, spaceYT, % (toggle:=!toggle)?"On":"Off"
Tooltip, % (toggle)?"On":""
return
spaceYT:
Send +{Space}
;Tooltip triggered
return
Code: Select all
F1::flag:=!flag ; changes flag from true to false; flag can be almost any name you want, it's not a special variable
#If WinActive("YouTube") && flag ; change the WinActive line to whichever works for you with suggestions from earlier in the thread
f::F11 ; or you can do f::Send {F11}
#If ; resets context sensitivity for all hotkeys below this. The bottom most #If also affects hotkeys at the top of the script, it has a "Wrap around" behavior.
; In this script alone, this is necessary for the F1 hotkey to be active at all times. Or a #If can be explicitly placed at the top of the script if that is more clear for you.
Users browsing this forum: Bing [Bot], oldbrother, ShatterCoder, Skrell and 139 guests