Groupadd in a loop only add the last window Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
standin000
Posts: 3
Joined: 12 Aug 2020, 21:46

Groupadd in a loop only add the last window

13 Aug 2020, 00:17

Code: Select all

IniRead, GroupList, %IniFile%, Settings, GroupList

Loop, Parse, GroupList, |
{
;    MsgBox, %A_LoopField%
    GroupAdd, group, % A_LoopField
}
#ifWinNotActive ahk_group group
....

GroupList = ahk_class A | ahk_class B

only match the last window in GroupList,

It seems strangely, if I write GroupAdd several times to add windows in GroupList, it is OK.
Rohwedder
Posts: 3661
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Groupadd in a loop only add the last window  Topic is solved

13 Aug 2020, 03:17

Hallo,
try:

Code: Select all

GroupAdd, group, % Trim(A_LoopField)
standin000
Posts: 3
Joined: 12 Aug 2020, 21:46

Re: Groupadd in a loop only add the last window

14 Aug 2020, 18:38

Rohwedder wrote:
13 Aug 2020, 03:17
Hallo,
try:

Code: Select all

GroupAdd, group, % Trim(A_LoopField)
thanks, it works like a magic!
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
GitHub: AAhkUser
Location: France

Re: Groupadd in a loop only add the last window

15 Aug 2020, 08:40

The following should also work (not tested):

Code: Select all

; ...
Loop, Parse, GroupList, |, %A_Space%%A_Tab%
{
	; ...
}
; ...
AhkUser
my scripts
standin000
Posts: 3
Joined: 12 Aug 2020, 21:46

Re: Groupadd in a loop only add the last window

17 Aug 2020, 00:54

A_AhkUser wrote:
15 Aug 2020, 08:40
The following should also work (not tested):

Code: Select all

; ...
Loop, Parse, GroupList, |, %A_Space%%A_Tab%
{
	; ...
}
; ...
AhkUser
I have tested, it is OK, thanks!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot] and 33 guests