Leanna Posted January 27, 2012 Posted January 27, 2012 Hello, Could you help me, how can I activate a Chrome tab? The tab is not active among other Chrome tabs. WinActivate("[TITLE:Yahoo! - Google Chrome]") This code works only if "Yahoo! - Google Chrome" is an active tab in Chrome, in this case it works even if chrome is minimized or inactive.The code doesn't work if another tab is active for ex. Google tab. Could you help me to solve it?
JohnOne Posted January 27, 2012 Posted January 27, 2012 (edited) Opt("WinTitleMatchMode",2) WinActivate("[TITLE:Google Chrome]") Edited January 27, 2012 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Leanna Posted January 28, 2012 Author Posted January 28, 2012 I've tested it. Opt("WinTitleMatchMode",2) WinActivate("[TITLE:Yahoo! - Google Chrome]") Works the same as WinActivate("[TITLE:Yahoo! - Google Chrome]") i.e. If chrome is inactive and the tab Yahoo is active - it activates Chrome, but if Chrome is inactive and Yahoo tab is inactive - nothing happens. Is there something else for solution? Thank you for trying to help.
somdcomputerguy Posted January 28, 2012 Posted January 28, 2012 (edited) Both of those snippets should work the same, Leanna, the WinActivate line is the same in both of them. Try JohnOne's post again. Basically, with WinTitleMatchMode - 2, and [TITLE:Google Chrome], Chrome will be activated no matter which tab is current. That is what you're after, right? See the help file for more info about WinTitleMatchMode. Edited January 29, 2012 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
JohnOne Posted January 29, 2012 Posted January 29, 2012 I would have thought that would work Try it this way if it does not Opt("WinTitleMatchMode",2) WinActivate("Google Chrome") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Leanna Posted January 29, 2012 Author Posted January 29, 2012 Yes, this works, it opens chrome. But what I need is to open a preopened tab with the Name Yahoo!. And the Yahoo tab may be not active. For example I have several tabs opened in Chrome: Google Yahoo and Amazon. Google tab is active. But i need to activate Yahoo tab. Is that possible?
somdcomputerguy Posted January 29, 2012 Posted January 29, 2012 With the FF.au3 UDF, in the Example Scripts forum, this would be possible. With Firefox though. I don't think there is a UDF for Chrome that would make this possible. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Mikeman27294 Posted January 29, 2012 Posted January 29, 2012 Just send a keystroke, if you already know the position of the opened tab. Try pressing CTRL+1, then CTRL+2, then 3 and 4 and see what happens to the tabs. You could then possibly set wintitlematchmode to 0 again to check whether it is the correct tab open. It is a dodgy work-around, but it could work.
glumbler Posted December 8, 2015 Posted December 8, 2015 (edited) Func Quora () WinActivate ( " - Google Chrome" ) _SendEx ( "^l" ) _SendEx ("tab ") Sleep ( 50 ) _SendEx ( "quora") Sleep ( 50 ) _SendEx ("{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}") Sleep ( 50 ) _SendEx ( "{ENTER}" ) ;FindTab () EndFuncRequires the TabTab Search Chrome Extension Edited December 9, 2015 by glumbler Found a better way...
khaihong Posted February 3, 2016 Posted February 3, 2016 I can't believe there isn't a function for this, I was looking for one. Despite this being a really old thread, it showed up near the top of my search, so I'll put my solution here for posterity. A simple (6 lines) "while" loop will do the job: WinActivate("[TITLE:Google Chrome]") $currTab = WinGetTitle("[ACTIVE]") while StringInStr($currTab, "Yahoo!") = 0 Send('^{TAB}') $currTab = WinGetTitle("[ACTIVE]") WEnd Nas and Golf_Hack 2
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