ctrl+ tab to go to next tab in browser is acting randomly, sometimes skips tabs

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
autohotkeycool
Posts: 137
Joined: 24 May 2016, 08:23

ctrl+ tab to go to next tab in browser is acting randomly, sometimes skips tabs

07 Feb 2020, 10:15

Ive made this script which goes to the next tab by pressing ctrl+ tab , but its randomly changing tabs twice or three times instead of once. Im wondering what I should change in the script so that itl only go to the next tab (1 tab to the right) so that it wont randomly move tab more than one to the right. Heres a gif of what I mean https i.imgur.com /XLTXiTk.gifv Broken Link for safety see the “Exchange” tabs are moving right twice, I want them only to move right once, like the “Oddschecker” tabs

Code: Select all

    #If Winactive("ahk_exe brave.exe") ;Hotkeys below are only active if this is true
    *Numpad1::
            SetTitleMatchMode, 2 ;Find text anywhere in window title
         WinActivate, Oddschecker ;Activate first window with "Oddschecker" somewhere in the title
        Send, {ctrl Down}{tab}{ctrl Up} ;Send Ctrl + 1
        Sleep, 100
        Send, ^{r}
        Sleep, 100
    
        WinActivate, Exchange ;Activate first window with "Exchange" somewhere in the title
        Send, {ctrl Down}{tab}{ctrl Up} ;Send Ctrl + 1
        Sleep, 100
    
        WinActivate, Matchbook ;Activate first window with "Matchbook" somewhere in the title
        Send, ^{tab} ;Send Ctrl + 1
        Sleep, 100
    
    
        WinActivate, Timeform ;Activate first window with "Matchbook" somewhere in the title
        Send, ^{tab} ;Send Ctrl + 1
        Sleep, 100
    Return
    #If ;Reset hotkey context-sensitivity
wbm1113
Posts: 18
Joined: 28 Aug 2018, 11:19

Re: ctrl+ tab to go to next tab in browser is acting randomly, sometimes skips tabs

07 Feb 2020, 19:28

its randomly changing tabs twice or three times instead of once
Because that's what you told it to do. You press Numpad1, it activates Oddschecker and sends those keystrokes. It doesn't stop there because you didn't tell it to. So it keeps going to Exchange, Matchbook, Timeform. There's no if statement or condition to tell it to stop. Every time you press Numpad1, it sends 4 winactivate commands, a ctrl+R input, and 4 ctrl+tab inputs.
wondering what I should change in the script so that itl only go to the next tab (1 tab to the right) so that it wont randomly move tab more than one to the right.
Why not just press ctrl+tab?
wbm1113
Posts: 18
Joined: 28 Aug 2018, 11:19

Re: ctrl+ tab to go to next tab in browser is acting randomly, sometimes skips tabs

07 Feb 2020, 19:37

If you only want it to send one Ctrl+TAB command, then you need to set up a condition for it to do that. The script you have just sends all those commands every time you press Numpad1.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, peter_ahk and 407 guests