How to switch between Tabs?

Advanced Macro Recorder/Editor.

Moderator: Pulover

udir
Posts: 3
Joined: 17 Mar 2021, 14:38

How to switch between Tabs?

Post by udir » 31 Mar 2021, 06:41

Hi,

I am a beginner. I am trying to automate simple tasks like switching tabs and pressing buttons. I watched the first tutorial and run Demo.pmc and although this tool looks like the best tool to my needs and although It looks to me that I understand the examples, it doesn't work for me and I am trying to understand why. I am using vesion 5.4.0

Here is a simple example. I am loading Notepad++ and try to switch to "new1".

Code: Select all

Run, notepad++.exe, C:\Program Files\Notepad++\
Sleep, 1000
ControlClick, SysTabControl325,  ahk_class Notepad++,, Left, 1,  NA
Sleep, 10
image.png
image.png (45.12 KiB) Viewed 1170 times
Please advise,

Udi Raz

User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: How to switch between Tabs?

Post by Pulover » 31 Mar 2021, 07:09

In this case you need to set the coordinates for the ControlClick or it's going to click at the center of the control. There's also a Control command to select tabs that you can try.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)

udir
Posts: 3
Joined: 17 Mar 2021, 14:38

Re: How to switch between Tabs?

Post by udir » 31 Mar 2021, 09:09

thanks for you quick respond, but none of the options below works. What am I missing?

Code: Select all

Run, notepad++.exe, C:\Program Files\Notepad++\
WinWaitActive, *new 1 - Notepad++
Sleep, 333
Sleep, 1000
ControlClick, SysTabControl325, ahk_class Notepad++,, Left, 1,  NA
Sleep, 10
ControlClick, , A,, Left, 1,  x237 y19 NA
Sleep, 10
Control, Choose, , SysTabControl325, ahk_class Notepad++
ControlMove, , 9, 114, 657, 641, A
Control, TabRight, , , A

User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: How to switch between Tabs?

Post by Pulover » 31 Mar 2021, 11:49

You have to se the control AND the coordinates, not one or the other. And the direct command is not Control, Choose, it's Control, TabLeft or TabRight. Read the ahk documentation for more information.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)

Post Reply

Return to “Pulovers Macro Creator”