- no longer Singleinstance force
- fixed string reverse method
With this script u can make a rightclick on marked files and there is a new option called "Organize".
if u click on "Organize" the file will be moved in the directory wich u wrote in the ini.txt.
it's very simple.
example of an ini.txt:
w3x = E:\Games\Warcraft III\Maps\Download mp3 * wav * wmv = E:\Musik jpeg * ico * jpg * bmp * tga * gif * psd = E:\Bilderw3x is the filesuffix of warcraft3 maps..
and if i click right of a w3x map...and click organized...then the file will automaticly moved to "E:\Games\Warcraft III\Maps\Download"
if u want to move musicfils of many kinds to one directory...u seperate the suffixes with a *
so in this example will move all marked files wich are .wav, .mp3 or .wmv to "E:\Musik"
to initialize the script (make an entry to the registry so that the new options in the context menue is set). u got do doubleclick it one time.
then u can leave it there and u got the new option ..
have fun with it.
:wink:
; Language: German/ English
; Platform: winXP, Win7
; Author: GDur <g-dur@hotmail.de>
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#NoTrayIcon
#SingleInstance
RegRead, regpath , HKEY_CLASSES_ROOT, *\shell\Organize\Command,
regpathV = AutoHotkey.exe "%A_ScriptFullPath%" "`%1"
IfNotInString, regpath, %regpathV%
{
MsgBox,
(
Registryentry changed.
This is the new path:
%regpathV%
)
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\Organize\Command,, AutoHotkey.exe "%A_ScriptFullPath%" "`%1"
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AllFilesystemObjects\shell\Organize\Command,, AutoHotkey.exe "%A_ScriptFullPath%" "`%1"
}
if(%0% > 0)
{
fullPath = %1% ; <- the error was here
}else
{
ExitApp
}
reversefullPath := revtxt(fullPath)
StringGetPos, pos, reversefullPath, .
if pos >= 0
{
organizeThis(fullPath)
}else
{
FileList = ; Initialize to be blank.
Loop, %fullPath%\*.*
FileList = %FileList%%A_LoopFileName%`n
Sort, FileList, R ; The R option sorts in reverse order. See Sort for other options.
Loop, parse, FileList, `n
{
if A_LoopField = ; Ignore the blank item at the end of the list.
continue
organizeThis(fullPath "\" A_LoopField)
}
}
ExitApp
revtxt(inVar)
{
VarSetCapacity(out, n:=StrLen(inVar))
Loop %n%
out .= SubStr(inVar, n--, 1)
return out
}
organizeThis(fullPath)
{
reversefullPath := revtxt(fullPath)
StringGetPos, pos, reversefullPath, .
StringLeft, reversefullPath, reversefullPath, %pos%
path_suffix := revtxt(reversefullPath)
Loop, read, ini.txt
{
StringSplit, zeile, A_LoopReadLine, = , %A_Space%%A_Tab%
StringSplit, Array, zeile1, * , %A_Space%%A_Tab%
Loop, %Array0%
{
suffix := Array%a_index%
path_suffix := path_suffix
if suffix = %path_suffix%
{
FileMove, %fullPath%, %zeile2%
}
}
}
}
;Esc::ExitAppi made a little uninstall-script wich removes the registry-entrys..
; My Language: German / English ; My Platform: Win 7 ; Author: GDur <g-dur@hotmail.de> ; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ;#NoTrayIcon RegDelete, HKEY_CLASSES_ROOT, *\shell\Organize RegDelete, HKEY_CLASSES_ROOT, AllFilesystemObjects\shell\Organize MsgBox, Deleted registry-entry (Uninstalled FRAn-Organizer) ExitApp




