ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > DC Member Programs and Projects

FileDraft - display newest files in a menu

(1/2) > >>

ak_:
This is a small ahk script i made for myself because i was looking for a way to easily access my latest downloads. Today i thought that maybe it could be useful to other people so i made little modifications and improvements and here it is.

fileDraft.exe (292.56 kB - downloaded 1857 times.)

Here's how fileDraft works : put fileDraft.exe anywhere and create a shortcut to this exe with two parameters. First one is the folder you want to browse, second one is the number of files you want to display.

Example :

* c:\fileDraft\fileDraft.exe "c:\downloads" 10 will display a menu showing the 10 most recent files in c:\downloads
FileDraft accepts a few keywords :
- <desktop> : desktop folder
- <user> : your "user folder" (i.e c:\documents and settings\username)
- <mydocs> : "My documents" folder
- <windir> : Windows folder

Examples :

* c:\fileDraft\fileDraft.exe "<mydocs>\Torrent Downloads" 5 will display a menu showing the 5 most recent files in the "My Documents\Torrent Downloads"
* c:\fileDraft\fileDraft.exe "<desktop>" 20 will display a menu showing the 20 most recent files on your desktop
The best way to use fileDraft is to place the shortcut on a toolbar or in the quicklaunch bar.

I hope someone will find it useful :)

jgpaiva:
Thanks ak_!

Just one thing.. Could you post the ahk source?
So that other people can learn with your expertise ;)

ak_:
Just one thing.. Could you post the ahk source?
So that other people can learn with your expertise ;)
-jgpaiva (August 08, 2007, 12:57 PM)
--- End quote ---
Of course ! I always hesitate before posting my sources because i feel that my code is quite messy.

Here it is :

--- ---; FileDraft
#NoTrayIcon
if 0 < 2
  ExitApp
 
WorkRep = %1%
StringCaseSense off
StringReplace WorkRep, Workrep, <desktop>, %A_Desktop%
StringReplace WorkRep, Workrep, <user>, %UserProfile%
StringReplace WorkRep, Workrep, <windir>, %A_Windir%
StringReplace WorkRep, Workrep, <mydocs>, %A_MyDocuments%
NFiles = %2%

Loop, %WorkRep%\*.*, 0
    FileList = %FileList%%A_LoopFileTimeModified%`t%A_LoopFileName%`n
Sort, FileList, R  ; Sort by date.

z = 1
Loop, parse, FileList, `n
{
    StringSplit, FileItem, A_LoopField, %A_Tab%  ; Split into two parts at the tab char.
    Menu, Fichiers, Add, %FileItem2%, LaunchFile
    if z = %NFiles%
      break
    z++
}

Menu, Fichiers, Show
return

LaunchFile:
run %WorkRep%\%A_ThisMenuItem%
ExitApp
return

MenzAgitat:
 
Simple but very useful.
Could you add right click support on listed files please ?

ak_:
I hope i'll be able to add icons and context-menu support in a future version :)

Navigation

[0] Message Index

[#] Next page

Go to full version