Desktop sorting

09/14/2013 18:19 kimboy600#1
Hi everyone , i'd like to share this script. (Tips and critics accepted)
HTML Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <Array.au3>
#include <Toast.au3>
$N = 1
Global $Files  
$Form1 = GUICreate("Sorting machine", 153, 90, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Button1 = GUICtrlCreateButton("Text", 0, 0, 75, 25)
$Button2 = GUICtrlCreateButton("Images", 77, 0, 75, 25)
$Button3 = GUICtrlCreateButton("Shortcuts", 0, 28, 152, 25)
$Exstention = GUICtrlCreateInput(".", 7, 56, 64, 24)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton("Custom", 77, 56, 75, 25)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		 Case $Button1
			DirCreate (@DesktopDir & "\Texts")
			$Files = _FileListToArray(@DesktopDir,"*.txt")
			$TF = $Files[0]
			$TFN = $Files[$N]
		 For $I = 1 To $TF Step 1 
			$TFN = $Files[$N]
			FileMove (@Desktopdir & "\" & $Files[$N],@DesktopDir & "\Texts\" & $Files[$N])
			$N = $N + 1
		 Next
			_Toast_Show(0,"","Copyed " & $TF & " file(s)",-3)
			_Toast_Hide()
			$N = 1   
		 Case $Button2
			DirCreate (@DesktopDir & "\Images")
			$Files = _FileListToArray(@DesktopDir,"*.png")
			$TF = $Files[0]
			$TFN = $Files[$N]
		 For $I = 1 To $TF Step 1 
			$TFN = $Files[$N]
			FileMove (@Desktopdir & "\" & $Files[$N],@DesktopDir & "\Images\" & $Files[$N])
			$N = $N + 1
		 Next
			_Toast_Show(0,"","Copyed " & $TF & " file(s)",-3)
			_Toast_Hide()
			$N = 1   
		 Case $Button3
			DirCreate (@DesktopDir & "\Shortcuts")
			$Files = _FileListToArray(@DesktopDir,"*.lnk")
			$TF = $Files[0]
			$TFN = $Files[$N]
		 For $I = 1 To $TF Step 1 
			$TFN = $Files[$N]
			FileMove (@Desktopdir & "\" & $Files[$N],@DesktopDir & "\Shortcuts\" & $Files[$N])
			$N = $N + 1
		 Next
			_Toast_Show(0,"","Copyed " & $TF & " file(s)",-3)
			_Toast_Hide()
			$N = 1   
		 Case $Button4
			DirCreate (@DesktopDir & "\Custom")
			$Files = _FileListToArray(@DesktopDir,"*" & GUICtrlRead ($Exstention))
			$TF = $Files[0]
			$TFN = $Files[$N]
		 For $I = 1 To $TF Step 1 
			$TFN = $Files[$N]
			FileMove (@Desktopdir & "\" & $Files[$N],@DesktopDir & "\Custom\" & $Files[$N])
			$N = $N + 1
		 Next
			_Toast_Show(0,"","Copyed " & $TF & " file(s)",-3)
			_Toast_Hide()
			$N = 1   
	  EndSwitch
	  
WEnd
Edit: I forgot to attach the UDF's file. Thanks alpines.
09/14/2013 19:20 alpines#2
Script has no use if you don't upload a .rar with the UDF.