autohotkey - Check all Tabs in browser with AHK -


i have code allready

!^j::     if winexist("the title")         winactivate     else         run, https://webpage/index.php return 

whenever hit hotkey, if web page wanted open, browser maximized. if web page not open, have open browser (or new tab if browser allready open) , go page. seems good, there 1 problem...

if browser open, , page open but browser no sitting in tab program open new tab, means every time browser in tab 1 containing page looked for, new tab open, how prevent this?

is there anyway fix it? function browser tabs , doing loop?

edit: @jsmith2800, have code:

!^j::     settitlematchmode, 2     winactivate, - mozilla firefox     settitlematchmode, 1     if winexist("the title")         winactivate     else {         wingetactivetitle, title         loop{             send ^{tab}             if winexist("the title")                 break             if winexist(title)                 break         }         if winexist(title)             run, https://webpage/index.php     } return 

first, have open browser window, ctrl+tab change tab. first 3 lines opening mozilla firefox.

then ask if page i'm looking in current tab, if is, activate tab. if not, current title , start loop.

in loop, first change tab, ask again if new tab 1 looking for. if new tab one, break loop , return. if not, ask if new tab same 1 before starting loop, if true, wanted page not openned, open , break loop.

this working right, except 1 little thing: the tabs acceded in random way, goes title page before reaching wanted one how can make not random. allready tried setwindelay, 250 didn't work.

i don't have great deal of experience autohotkey, found this seems cover need, you'd need combine of bits have there already, if understanding correct should this.

if winexist("the title")        winactivate     else {         wingetactivetitle, title             loop{                  send ^{tab}             if winactive ("the title")                 break             if winactive ("title")                 break                 run, https://webpage/index.php             else                 continue                 }             } 

i'm not 100% on looks little messy me (an if else statement nested within else statement) understanding should first see if title you're looking exists, if great, activate page. if doesn't drop next statement, record title of selected page variable 'title' , start loop, send keys ctrl+tab move next tab, if window title equals looking (in example, shown 'the title'), stop loop. if title equals title recorded @ start (i.e. have looped round open tabs) break loop, , open page need. if doesn't equal either of these, restart loop , hit ctrl+tab again, check title again etc until meets 1 of 2 above criteria.

hopefully you, if it's link website information on helps you, i'm not experience ahk user can't guarantee suggestion work, still luck it.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -