 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Sandeep
Joined: 29 Nov 2004 Posts: 10
|
Posted: Thu Dec 02, 2004 4:02 am Post subject: Loop, FilePattern [, IncludeFolders?, Recurse?, Sort?] |
|
|
I would like to see options to sort a list of files based on any of the available properties like Name, Size, Modified Date, Type.
For now, my particular need is to develop a mechanism which would completely eliminate the use of "Start Menu". After I have started using AHK, I find it quite difficult to go to Left-Bottom corner to access anything and then come back to center. Thanks for that!
But the only that is left in making this possible is Recent Documents list.
Sorting on modified date is the only reason I could not implement any replacement for it.
Further, "Recent Documents" also stores recent folders but surprisingly I could not find an easy method to use that information. I would like to use that folder list also (of course sorted on modified date). This would make the use of "FavoriteFolders" even more interesting.
Please help me realizing this! _________________ Sandeep |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu Dec 02, 2004 3:35 pm Post subject: |
|
|
Here is an example that sorts files by modification date. I'm not sure how Recent Files stores its dates, so you might need to change this to use Creation Date: | Code: | FileList =
Loop, %UserProfile%\Recent\*.*, 1
FileList = %FileList%%A_LoopFileTimeModified%`t%A_LoopFileName%`n
Sort, FileList
Loop, parse, FileList, `n
{
if A_LoopField = ; Omit the last linefeed (blank item) at the end of the list.
continue
StringSplit, FileItem, A_LoopField, %A_Tab% ; Split into two parts at the tab char.
MsgBox, 4,, The next file (modified at %FileItem1%) is:`n%FileItem2%`n`nContinue?
IfMsgBox, No
break
} |
|
|
| Back to top |
|
 |
Guest
|
Posted: Thu Dec 02, 2004 4:04 pm Post subject: |
|
|
This is working fine. Thanks!
I didn't notice that we already have %A_LoopFileTimeModified% within loop.
Sandeep |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|