JulienBoul Posted December 2, 2015 Share Posted December 2, 2015 Hi,it's my first message about autoit, i'm realy newbie and realy bad english speaker... Nothing for the win... :-/ lolI have 3 tabs on my Chrome browser.I Have found this code (thx to Dan Craciun) with long search on google.AutoItSetOption("WinTitleMatchMode", 2) $searchString = "YouTube" WinActivate ("Chrome") For $i = 1 to 100 Send("^" & $i) Sleep(250) If Not(StringInStr(WinGetTitle("[ACTIVE]"), $searchString) = 0) Then WinSetState($searchString,"",@SW_MAXIMIZE) ExitLoop EndIf NextToday, my Chrome browser stand up and activate on my screen, but tabs dont switch.I have replace Send("^" & $i) by Send("^a") and all my tab is selected (all in blue). If I clic on youtube tab, my window Maximize and the scrip stop. The problem is just an the line ->Send("^" & $i)If I clic in the notepad when my script is on, it write 0123456789 0123...How can i have a realy command ctrl+1, wait 250ms, ctrl +2... but now, my code is no good...For test this code, you need just have a chrome session open with 2 tabs, 1 active tab, and 1 not active tab with youtube.I think thix code can help everyone, if you would help me for my english i can edit, just MP me plz.Thx realy for help, I'm all red and my hair fall, plz save me lol. Link to comment Share on other sites More sharing options...
Kovacic Posted December 2, 2015 Share Posted December 2, 2015 (edited) Your code worked fine for me, Make sure chrome is on default settings, could be a plugin messing things up in chrome. Edited December 2, 2015 by Kovacic C0d3 is P0etry( ͡° ͜ʖ ͡°) Link to comment Share on other sites More sharing options...
Kovacic Posted December 2, 2015 Share Posted December 2, 2015 (edited) Ok I lied.. I added 50 tabs and it started pumping numbers everywhere... I moved a few things around which should help... AutoItSetOption("WinTitleMatchMode", 2) $searchString = "YouTube" For $i = 1 to 100 WinActivate ("Chrome") Send("^{TAB}") Sleep(250) If Not(StringInStr(WinGetTitle("[ACTIVE]"), $searchString) = 0) Then WinSetState($searchString,"",@SW_MAXIMIZE) ExitLoop EndIf Next I moved 'Winactivate' into the 'for' loop to keep focus on chrome, and instead of using a variable to count the number tabs, I just changed it to 'Ctrl + Tab', this will also let it loop over the tabs again. I did this because it doesn't seem chrome will support anything past Ctrl + 9 for tab switching.You can keep this a 'for' loop if you want to limit the number of tabs searched, or move it to a 'Do Until' loop to just go until it finds what its looking for. Edited December 2, 2015 by Kovacic C0d3 is P0etry( ͡° ͜ʖ ͡°) Link to comment Share on other sites More sharing options...
JulienBoul Posted December 4, 2015 Author Share Posted December 4, 2015 Thx very munch, it's ok now, AutoItSetOption("WinTitleMatchMode", 2) $searchString = "YouTube" For $i = 1 to 100 WinActivate ("Chrome") Send("^{TAB}") Sleep(250) If Not(StringInStr(WinGetTitle("[ACTIVE]"), $searchString) = 0) Then WinSetState($searchString,"",@SW_MAXIMIZE) ExitLoop EndIf Nextis the Key. You're my savior :-PThank you very much the subject is closed. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now