Hello everyone,
I am a new member of this community.
I am trying to learn the script for my personal use.
On windows 10 most of the time I work with apps like Word, Excel, Abobe Acrobat, Chrome, Notepad etc. I don't like Windows' built-in Alt+Tab toggle command.
Could you please help me with a script that toggle among several apps with a single key stroke when I wish to toggle?
Since I am a newbie, I would like simpler scripts.
I am using Version 1.1.33.09
Thanks in Advance
Fazlul
Toggle among several apps with single key stroke Topic is solved
-
- Posts: 12
- Joined: 15 Jun 2021, 22:03
Re: Toggle among several apps with single key stroke
Code: Select all
F3::
hwnd := []
WinGet, win, List
Loop, %win% {
WinGet, proc, ProcessName, % "ahk_id " win%A_Index%
proc := StrReplace(proc, ".exe")
If proc in WINWORD,EXCEL,Acrobat,chrome,notepad
hwnd.Push(win%A_Index%)
}
If !hwnd.Count() {
SoundBeep, 1000
Return
}
If WinActive(act := "ahk_id " hwnd.1) {
If hwnd.Count() > 1 {
WinSet, Bottom
WinActivate, % "ahk_id " hwnd.2
} Else SoundBeep, 1500
} Else WinActivate, %act%
Return
-
- Posts: 12
- Joined: 15 Jun 2021, 22:03
Re: Toggle among several apps with single key stroke
Thank you .....
but there are some problems.
1. I can toggle forward from first app to the last, but cannot toggle back
2. It is not working properly if I open 4 apps.
I have a question here:
If I want to write the names of the apps in the script (eg, Chrome, Word, Adobe Acrobat), what should be the script like?
Thanks in advance.
but there are some problems.
1. I can toggle forward from first app to the last, but cannot toggle back
2. It is not working properly if I open 4 apps.
I have a question here:
If I want to write the names of the apps in the script (eg, Chrome, Word, Adobe Acrobat), what should be the script like?
Thanks in advance.
Re: Toggle among several apps with single key stroke
How would you distinguish between stepping (toggling) forward and back with a single keystroke?
Re: Toggle among several apps with single key stroke
I was thinking the same as boiler. This script worked for me when I opened multiple windows of different kinds that are shown in the list of process names. You could change that list to whatever you like. The process list that I used is the same as the one that you provided.
-
- Posts: 12
- Joined: 15 Jun 2021, 22:03
-
- Posts: 12
- Joined: 15 Jun 2021, 22:03
Re: Toggle among several apps with single key stroke
Is it possible to use GroupAdd and GroupActivate here?mikeyww wrote: ↑16 Jun 2021, 09:20I was thinking the same as boiler. This script worked for me when I opened multiple windows of different kinds that are shown in the list of process names. You could change that list to whatever you like. The process list that I used is the same as the one that you provided.
Re: Toggle among several apps with single key stroke
That should work and be a pretty simple solution.
Re: Toggle among several apps with single key stroke
A great idea! Probably better than what I wrote.
-
- Posts: 12
- Joined: 15 Jun 2021, 22:03
Re: Toggle among several apps with single key stroke
Code: Select all
GroupAdd, procs, ahk_exe WINWORD.exe
GroupAdd, procs, ahk_exe EXCEL.exe
GroupAdd, procs, ahk_exe Acrobat.exe
GroupAdd, procs, ahk_exe chrome.exe
GroupAdd, procs, ahk_exe notepad.exe
F3::GroupActivate, procs, R
-
- Posts: 12
- Joined: 15 Jun 2021, 22:03
Re: Toggle among several apps with single key stroke Topic is solved
Thank you very much. It is working great!mikeyww wrote: ↑17 Jun 2021, 07:20Code: Select all
GroupAdd, procs, ahk_exe WINWORD.exe GroupAdd, procs, ahk_exe EXCEL.exe GroupAdd, procs, ahk_exe Acrobat.exe GroupAdd, procs, ahk_exe chrome.exe GroupAdd, procs, ahk_exe notepad.exe F3::GroupActivate, procs, R
You are really helpful.
Who is online
Users browsing this forum: No registered users and 219 guests