moving between chrome tabs

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
kinbeat
Newbie
Posts: 1
Joined: Tue Nov 30, 2021 1:29 pm

moving between chrome tabs

Post by kinbeat » Tue Nov 30, 2021 1:37 pm

Hi,
i'm using the macro scheduler for the first time, i'm finding it pretty useful, but i can't find a command that switches between chrome tabs.
Basically, i used image recognition to clic on a sequence of icons on the tab i'm working, but sometimes the macro will misclick and click a link, which opens up in a different chrome tab in the same window, stopping the script.

I tried "setfocus" but the menu only shows the active tab for that window, which of course it's the opposite of what i need.
I also tried image recognition on the tab header, but it won't work, i don't know why.

So i either need a command that returns to a specific tab, or a command that closes a tab in the case one opens accidentaly.

thanks.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: moving between chrome tabs

Post by Dorian (MJT support) » Tue Nov 30, 2021 2:15 pm

If you want to use mouse clicks and keyboard, and you have Chrome focused, you can use they keyboard shortcuts to go to the next/previous tabs.

Code: Select all

setfocus>Google Chrome*
press ctrl
press page down
release ctrl

Code: Select all

setfocus>Google Chrome*
press ctrl
press page up
release ctrl
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: moving between chrome tabs

Post by Grovkillen » Tue Nov 30, 2021 3:27 pm

Can't you monitor the window title and if the title text change use the CTRL+W to close the active tab.
Let>ME=%Script%

Running: 15.0.27
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts