Jump to content


Photo

ProFiler: One-click File Organization


  • Please log in to reply
No replies to this topic

#1 RobMonty1987

RobMonty1987
  • Members
  • 12 posts

Posted 25 September 2012 - 05:10 AM

Here is a simple program I made yesterday called ProFiler. The goal is to allow users to automatically organize all of the clutter on their desktop in a single click. It is geared towards maintaining a neat workspace on the desktop.

DOWNLOAD HERE 398kb - (hosted @ 4Shared.com)

---------------------------------------------------------------------------------------------------

What it does:
Moves files into their corresponding folders automatically. (Ex: All pictures moved to 'pictures' folder; All Word documents moved to 'documents' folder; etc.)
Users can customize which types of files are moved and where they are moved to, and then save those settings for easy single-click use.

Purpose:
One-click organization of your desktop. I created this mainly to clean up the many unorganized laptops and desktops I run into as a bench tech. In the long run, it will save me alot of time.

Notes:
So far, I have only set it to organize five types of files: Shortcuts, Pictures, Music, Video, and MS Office documents. Please note that this does NOT mean just five file extensions. If you look through the code you can see which file extensions are covered (there are many).

Future Additions:
- More types of files covered (zip, rar, folders, exes, etc)
- Option to choose the directory to be organized (not just desktop)
- Option to customize and save preset actions (Ex: 'Clean Desktop'; 'Organize Pictures'; etc.)
- Scheduled cleaning
- Batch renaming of files for alphabetization

- Will eventually streamline code

---------------------------------------------------------------------------------------------------

I'd love to hear some feedback and ideas, guys. Thanks.

;=================
;PRE-SET VARIABLES
;=================
x = Center
y = Center

;=================
;VARIABLE EXAMPLES
;=================
;vFile		= Toggle ON/OFF
;vFileDIR	= Destination 
;vEditFileDIR	= Change destination

;============
;PROFILER.TXT
;============
;Line 1:	Shortcuts	(Directory)
;Line 2:	Pictures	(Directory)
;Line 3:	Music		(Directory)
;Line 4:	Videos		(Directory)
;Line 5:	Office Files	(Directory)
;Line 6:	Shortcuts	(Toggle)
;Line 7:	Pictures	(Toggle)
;Line 8:	Music		(Toggle)
;Line 9:	Videos		(Toggle)
;Line 10:	Office Files	(Toggle)

;=================
;VARIABLE EXAMPLES
;=================
Default:
IfNotExist, C:\Users\%A_UserName%\Documents\ProFiler.txt
	FileAppend, C:\Users\%A_UserName%\Desktop`nC:\Users\%A_UserName%\Pictures`nC:\Users\%A_UserName%\Music`nC:\Users\%A_UserName%\Videos`nC:\Users\%A_UserName%\Documents`n1`n1`n1`n1`n1, C:\Users\%A_UserName%\Documents\ProFiler.txt
Reset:
FileReadLine, ShortcutsDIR, C:\Users\%A_UserName%\Documents\ProFiler.txt, 1
FileReadLine, PicturesDIR, C:\Users\%A_UserName%\Documents\ProFiler.txt, 2
FileReadLine, MusicDIR, C:\Users\%A_UserName%\Documents\ProFiler.txt, 3
FileReadLine, VideosDIR, C:\Users\%A_UserName%\Documents\ProFiler.txt, 4
FileReadLine, OfficeFilesDIR, C:\Users\%A_UserName%\Documents\ProFiler.txt, 5
FileReadLine, Shortcuts, C:\Users\%A_UserName%\Documents\ProFiler.txt, 6
FileReadLine, Pictures, C:\Users\%A_UserName%\Documents\ProFiler.txt, 7
FileReadLine, Music, C:\Users\%A_UserName%\Documents\ProFiler.txt, 8
FileReadLine, Videos, C:\Users\%A_UserName%\Documents\ProFiler.txt, 9
FileReadLine, OfficeFiles, C:\Users\%A_UserName%\Documents\ProFiler.txt, 10

;========
;SETTINGS
;========
ReloadGUI:
Gui, Destroy
Gui,+ToolWindow
Gui,+Border
Gui, Add, Checkbox, x5 y12 Checked%Shortcuts% vShortcuts
Gui, Add, Text, x35 y12 w100, Shortcuts:
Gui, Add, Edit, x125 y10 w200 vShortcutsDIR, %ShortcutsDIR%
Gui, Add, Button, x335 y9 w30 h20 vEditShortcutsDIR, 1`n`nEdit`n`n1

Gui, Add, Checkbox, x5 y42 Checked%Pictures% vPictures
Gui, Add, Text, x35 y42 w100, Pictures:
Gui, Add, Edit, x125  y40 w200 vPicturesDIR, %PicturesDIR%
Gui, Add, Button, x335 y39 w30 h20 vEditPicturesDIR, 2`n`nEdit`n`n2

Gui, Add, Checkbox, x5 y72 Checked%Music% vMusic
Gui, Add, Text, x35 y72 w100, Music:
Gui, Add, Edit, x125  y70 w200 vMusicDIR, %MusicDIR%
Gui, Add, Button, x335 y69 w30 h20 vEditMusicDIR, 3`n`nEdit`n`n3

Gui, Add, Checkbox, x5 y102 Checked%Videos% vVideos
Gui, Add, Text, x35 y102 w100, Videos:
Gui, Add, Edit, x125  y100 w200 vVideosDIR, %VideosDIR%
Gui, Add, Button, x335 y99 w30 h20 vEditVideosDIR, 4`n`nEdit`n`n4

Gui, Add, Checkbox, x5 y132 Checked%OfficeFiles% vOfficeFiles
Gui, Add, Text, x35 y132 w100, Office Files:
Gui, Add, Edit, x125  y130 w200 vOfficeFilesDIR, %OfficeFilesDIR%
Gui, Add, Button, x335 y129 w30 h20 vEditOfficeFilesDIR, 5`n`nEdit`n`n5

Gui, Add, Button, x5 y165 w60 h25 Apply, Apply
Gui, Add, Button, x305 y165 w60 h25 Default, Default
Gui, Add, Button, x70 y165 w230 h25 CleanUp!, &CleanUp!
Gui, Show, x%x% y%y% w370
Return



;=======
;BUTTONS
;=======
Button1Edit1:
Gui, Submit
FileSelectFolder, ShortcutsDIR,, Add 2, Move to:
	if ErrorLevel
	Return
Goto, ReloadGUI
;------------------------------------------------
Button2Edit2:
Gui, Submit
FileSelectFolder, PicturesDIR,, Add 2, Move to:
	if ErrorLevel
	Return
Goto, ReloadGUI
;------------------------------------------------
Button3Edit3:
Gui, Submit
FileSelectFolder, MusicDIR,, Add 2, Move to:
	if ErrorLevel
	Return
Goto, ReloadGUI
;------------------------------------------------
Button4Edit4:
Gui, Submit
FileSelectFolder, VideosDIR,, Add 2, Move to:
	if ErrorLevel
	Return
Goto, ReloadGUI
;------------------------------------------------
Button5Edit5:
Gui, Submit
FileSelectFolder, OfficeFilesDIR,, Add 2, Move to:
	if ErrorLevel
	Return
Goto, ReloadGUI
;------------------------------------------------
ButtonApply:
WinGetPos, x, y
Gui, Submit
IfExist, C:\Users\%A_UserName%\Documents\ProFiler.txt
	FileDelete, C:\Users\%A_UserName%\Documents\ProFiler.txt
FileAppend, %ShortcutsDIR%`n%PicturesDIR%`n%MusicDIR%`n%VideosDIR%`n%OfficeFilesDIR%`n%Shortcuts%`n%Pictures%`n%Music%`n%Videos%`n%OfficeFiles%, C:\Users\%A_UserName%\Documents\ProFiler.txt
Goto, ReloadGUI
;------------------------------------------------
ButtonDefault:
WinGetPos, x, y
FileDelete, C:\Users\%A_UserName%\Documents\ProFiler.txt
Goto, Default
;------------------------------------------------
ButtonCleanUp!:
Gui, Submit
SetTimer, Tip, 5
If Shortcuts = 1
	{
	FileMove, %A_Desktop%\*.lnk, %ShortcutsDIR%\*.lnk
	}
If Pictures = 1
	{
	FileMove, %A_Desktop%\*.jpg, %PicturesDIR%\*.jpg
	FileMove, %A_Desktop%\*.jpeg, %PicturesDIR%\*.jpeg
	FileMove, %A_Desktop%\*.bmp, %PicturesDIR%\*.bmp
	FileMove, %A_Desktop%\*.png, %PicturesDIR%\*.png
	FileMove, %A_Desktop%\*.gif, %PicturesDIR%\*.gif
	}
If Music = 1
	{
	FileMove, %A_Desktop%\*.mp3, %MusicDIR%\*.mp3
	FileMove, %A_Desktop%\*.wma, %MusicDIR%\*.wma
	FileMove, %A_Desktop%\*.wav, %MusicDIR%\*.wav
	FileMove, %A_Desktop%\*.ra, %MusicDIR%\*.ra
	FileMove, %A_Desktop%\*.ram, %MusicDIR%\*.ram
	FileMove, %A_Desktop%\*.ogg, %MusicDIR%\*.ogg
	}
If Videos = 1
	{
	FileMove, %A_Desktop%\*.3gp, %VideosDIR%\*.3gp
	FileMove, %A_Desktop%\*.amv, %VideosDIR%\*.amv
	FileMove, %A_Desktop%\*.asf, %VideosDIR%\*.asf
	FileMove, %A_Desktop%\*.asx, %VideosDIR%\*.asx
	FileMove, %A_Desktop%\*.avi, %VideosDIR%\*.avi
	FileMove, %A_Desktop%\*.divx, %VideosDIR%\*.divx
	FileMove, %A_Desktop%\*.moov, %VideosDIR%\*.moov
	FileMove, %A_Desktop%\*.mov, %VideosDIR%\*.mov
	FileMove, %A_Desktop%\*.mpg, %VideosDIR%\*.mpg
	FileMove, %A_Desktop%\*.mp4, %VideosDIR%\*.mp4
	FileMove, %A_Desktop%\*.qt, %VideosDIR%\*.qt
	FileMove, %A_Desktop%\*.rm, %VideosDIR%\*.rm
	FileMove, %A_Desktop%\*.swf, %VideosDIR%\*.swf
	FileMove, %A_Desktop%\*.wmv, %VideosDIR%\*.wmv
	}
If OfficeFiles = 1
	{
	FileMove, %A_Desktop%\*.doc, %OfficeFilesDIR%\*.doc
	FileMove, %A_Desktop%\*.xls, %OfficeFilesDIR%\*.xls
	FileMove, %A_Desktop%\*.ppt, %OfficeFilesDIR%\*.ppt
	FileMove, %A_Desktop%\*.docx, %OfficeFilesDIR%\*.docx
	FileMove, %A_Desktop%\*.xlsb, %OfficeFilesDIR%\*.xlsb
	FileMove, %A_Desktop%\*.pptx, %OfficeFilesDIR%\*.pptx
	FileMove, %A_Desktop%\*.pst, %OfficeFilesDIR%\*.pst
	FileMove, %A_Desktop%\*.xlsx, %OfficeFilesDIR%\*.xlsx
	FileMove, %A_Desktop%\*.rtf, %OfficeFilesDIR%\*.rtf
	FileMove, %A_Desktop%\*.txt, %OfficeFilesDIR%\*.txt
	FileMove, %A_Desktop%\*.pdf, %OfficeFilesDIR%\*.pdf
	}
SetTimer, Tip, OFF
MsgBox, Done!`n`nYour files have been organized.
Return

Tip:
ToolTip, Cleaning files...
Return