Sort By Date Modified Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AngryPig

Sort By Date Modified  Topic is solved

23 Mar 2018, 12:08

I know there is example four of - https://autohotkey.com/docs/commands/LoopFile.htm - to do this but this does not allow me to use %A_LoopFileName%, %A_LoopFileLongPath% etc because they are in a Parse Loop not File Loop.

How do I get that information inside the Parse loop?
garry
Posts: 3764
Joined: 22 Dec 2013, 12:50

Re: Sort By Date Modified

23 Mar 2018, 14:56

an example

Code: Select all

#warn
e4x:=""
e:=""
f1=%a_scriptdir%\ByDateSorted_txt.txt
ifexist,%f1%
  filedelete,%f1%
setworkingdir,%a_scriptdir%
fd1=%a_desktop%
Loop, %fd1%\*.txt, 0, 1
    e4x .= A_LoopFileTimeModified . ";" . A_LoopFileFullPath "`r`n"
Sort, e4x                  ;- Sort by date.
Loop, Parse,e4x, `n,`r
{
 x=%a_loopfield%
  if x=
    continue
 stringsplit,C,x,`;
 e .= c2 . "`r`n"
}
Fileappend,%e%,%f1%
run,%f1%
exitapp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 237 guests