ListView not updated after execution Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Dogway
Posts: 4
Joined: 17 Apr 2015, 05:25

ListView not updated after execution

29 Jul 2019, 16:35

I'm having issues with this script.
ListView is not being updated according to LV_Modify for some reason, so I can't run it a second time.

Code: Select all

ButtonOK:

Loop, Parse, FileList, `n
	{
		SplitPath, A_LoopField, name, Path, ext, name_no_ext, drives
		StringTrimRight, NewName, name_no_ext, 1
		FileMove, %A_LoopField%, %Path%\%NewName%.%ext%, 1
		LV_Modify(A_Index, "", NewName . "." . ext, Path, ext)
	}

GuiControl, +Redraw, FileList
sleep, 150
MsgBox, 4096, %A_Space%, `nFinished
Return
Last edited by Dogway on 30 Jul 2019, 05:02, edited 1 time in total.
hd0202
Posts: 163
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: ListView not updated after execution  Topic is solved

29 Jul 2019, 23:39

You cannot simply PARSE the listview, you must use LV_functions to get the number of rows (and/or number of columns) and the text:

Code: Select all

ButtonOK:
; Loop, Parse, FileList, `n
Loop % LV_GetCount()
	{
		LV_GetText(FileName, A_Index, 1)
		SplitPath, FileName, name, Path, ext, name_no_ext, drives
		LV_GetText(Path, A_Index, 2)
		StringTrimRight, NewName, name_no_ext, 1
		FileMove, %A_LoopField%, %Path%\%NewName%.%ext%, 1
		LV_Modify(A_Index, "", NewName . "." . ext, Path, ext)
	}

GuiControl, +Redraw, FileList
sleep, 150
MsgBox, 4096, %A_Space%, `nFinished
Return
Hubert
Dogway
Posts: 4
Joined: 17 Apr 2015, 05:25

Re: ListView not updated after execution

30 Jul 2019, 05:06

Thanks, worked great! I had the wrong concept that the ListView lived in a variable

Return to “Ask For Help”

Who is online

Users browsing this forum: Chunjee, Google [Bot], RubbeH and 46 guests