loop, files & Filemove problem

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
zzongk
Posts: 2
Joined: 24 Jul 2018, 11:15

loop, files & Filemove problem

16 Aug 2018, 08:09

Hi. Everyone
First time in here!

I faced abnornal result in my script

1. create TXT Files sequentially 01.kkk, 02.kkk, 03.kkk .....
2. try to rename 1-01.kkk, 2-02.kkk, 3-03.kkk ......

results failed to renaming sequentially

Code: Select all

FileDelete, *.kkk
Loop, 99
{
	fname := (a_index<10) ? "0" a_index : a_index
	fileappend, a , % fname ".kkk" ; create TXT Files sequently 01.kkk, 02.kkk, 03.kkk .....
}
MsgBox, 262160,,
Loop, *.kkk
	FileMove, %a_loopfilename%, %a_index%-%a_loopfilename% ; try to rename 1-01.kkk, 2-02.kkk, 3-03.kkk ......
MsgBox, 262160,,
Last edited by zzongk on 17 Aug 2018, 20:56, edited 6 times in total.
Dave_Scream
Posts: 7
Joined: 01 Jul 2016, 06:06

Re: loop, files & Filemove problem

16 Aug 2018, 10:06

on second line comma should be escaped with `

Code: Select all

FileName = a1,a2,a3
StringSplit, Split, FileName,`,
loop, *.txt
	FileMove, %a_loopfilename%, % Split%a_index% ".kkk"
zzongk
Posts: 2
Joined: 24 Jul 2018, 11:15

Re: loop, files & Filemove problem

17 Aug 2018, 02:24

Sorry my question is edited
Dave_Scream wrote:on second line comma should be escaped with `

Code: Select all

FileName = a1,a2,a3
StringSplit, Split, FileName,`,
loop, *.txt
	FileMove, %a_loopfilename%, % Split%a_index% ".kkk"

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: aitaixy, Joey5 and 231 guests