Welcome Guest.   Make a donation to an author on the site October 22, 2014, 10:28:40 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Read the full one-year retrospective report on DonationCoder.com.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: FileDraft - display newest files in a menu  (Read 11954 times)
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: August 08, 2007, 12:06:31 PM »

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 884 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 smiley
« Last Edit: September 04, 2007, 09:47:28 PM by ak_ » Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: August 08, 2007, 12:57:10 PM »

Thanks ak_!

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

ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: August 08, 2007, 12:59:48 PM »

Just one thing.. Could you post the ahk source?
So that other people can learn with your expertise Wink
Of course ! I always hesitate before posting my sources because i feel that my code is quite messy.

Here it is :
[copy or print]
; 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
Logged

MenzAgitat
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #3 on: August 09, 2007, 09:36:30 AM »

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

« Last Edit: August 09, 2007, 11:19:37 AM by MenzAgitat » Logged
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: August 10, 2007, 12:29:13 PM »

I hope i'll be able to add icons and context-menu support in a future version smiley
« Last Edit: August 10, 2007, 12:32:26 PM by ak_ » Logged

SirSmiley
Member
**
Posts: 64


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: September 02, 2007, 02:57:43 PM »

Very Cool.
I use a Windows Explorer Plugin called FindeXer & wrote a vbs drop script for anyone who wants it.
[copy or print]
Dim fDraft,dirName,fCount,strCommand

fDraft="C:\FileDraft\fileDraft.exe" 'Path to the FileDraft.exe
fCount="10" 'Number of files to show
'Drop script insures only one item was dropped.
'No file/folder error checking so, please just drop folders on it.
If WScript.Arguments.Count = 0 And WScript.Arguments.Count > 1 Then
  WScript.Quit
Else
dirName = WScript.Arguments.Item(0)
End If
'Build the string
strCommand=fDraft&" "&Chr(34)&dirName&Chr(34)&" "&fCount

Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Exec strCommand
WScript.Quit
Logged
justice
Supporting Member
**
Posts: 1,889



Solve issues simply.

View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: September 03, 2007, 06:57:22 AM »

Wow great idea on showing a context menu like that. that would make an fantastic alt-tab replacement tool. I made a small ahk script before with a different solution: recent files RSS feeds from folders (see my sig)
« Last Edit: September 03, 2007, 06:59:24 AM by justice » Logged

ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: September 04, 2007, 09:52:06 PM »

SirSmiley> good idea ! So good i added drag n drop support to FileDraft cheesy So now you can drop a folder on a filedraft shortcut (or filedraft.exe) and it will show 10 most recent files. See first post for download.

Now i'm thinking that context-menu support could be nice. Something like :
right click on a folder > click "FildeDraft" in the context menu > shows 10 most recent files

I could even make a config file to specify default number of files to show.

I'll see that tomorrow smiley
« Last Edit: September 04, 2007, 09:59:16 PM by ak_ » Logged

SirSmiley
Member
**
Posts: 64


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #8 on: October 06, 2007, 04:37:45 PM »

Sorry for the bump. I belong to way to many forums. smiley

I'm not familiar with the specific registry area for the context menu but, have been playing around with Fast Explorer which also has com object for developers.

It's fairly straight forward and might be of use. http://thesoftpro.tripod....om/downloads/fe/index.htm

Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.036s | Server load: 0.18 ]