Last in Loop

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JOBRO
Posts: 2
Joined: 03 Jul 2020, 13:54

Last in Loop

03 Jul 2020, 14:06

Hi,
I have created a script with a loop that works great. I have worked out how to do first in loop variations in other scripts but I haven't had any luck transferring this knowledge to code last in loop variations.

Code: Select all

Loop, %LoopNum%
{
settitlematchmode, 2
winactivate, Google Chrome
sleep, 25
var1 := ArrayOfCols[1][i] ; Style
send, %var1%
sleep, 500
send, {Enter}
sleep, 1000	
send, {Down}
sleep, 1500
i++
}
For the last loop only I would like to exclude this command:

Code: Select all

send, {Down}
Any help would be appreciated.
john_c
Posts: 493
Joined: 05 May 2017, 13:19

Re: Last in Loop

03 Jul 2020, 14:15

Maybe it's better to place this line after the loop?
JOBRO
Posts: 2
Joined: 03 Jul 2020, 13:54

Re: Last in Loop

03 Jul 2020, 16:00

I need this 'down' to occur for every other series in the loop however.
john_c
Posts: 493
Joined: 05 May 2017, 13:19

Re: Last in Loop

03 Jul 2020, 16:02

Ah, sorry, I misread your post. Let me think some time...
User avatar
Learning one
Posts: 173
Joined: 04 Oct 2013, 13:59
Location: Croatia
Contact:

Re: Last in Loop

03 Jul 2020, 18:29

Example:

Code: Select all

LoopNum := 3

Loop, %LoopNum%
{
	if (LoopNum = A_index)
		MsgBox, Last in Loop action
	else
		MsgBox, Action
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 344 guests