Oh, and i forgot to mention that Gothi[c] kindly created me a dcmembers account before i has to ask so the site should be up soon 


nogojoe> can you explain your request please ? I'm sorry, i didn't get it
Lanux> i'm using Subdude everyday tooI'm thinking of a new version, with better season/episode recognition, but it's tough because there are so many different patterns (the "401,402,403" being the more problematic).


I'll find a way.
However, at first I didn't think it changes were made immediately after selecting the FileNanny option. With the new version on my system the changes only occur after refreshing the folder view. I don't know if anyone else has noticed this behavior.
Thanks for the revision, I just thought I'd let you know about this behavior on my system.

Here is FileNanny 1.3.1 (version number kinda randomly chosen) : [not available];; FileNanny
;; version 1.3.1
;; "Go to your room !"
;; by ak
#SingleInstance ignore
iniFile = %A_ScriptDir%\FileNanny.ini
if 0 = 0
{
gosub CreateGUI
gosub checkboxes
}
else
{
Iniread shiftKey, %iniFile%, options, shiftKey
Iniread similar, %iniFile%, options, similarfiles
GetKeyState kstate, Shift
if (shiftKey = 1 and kstate = "D")
editFolder = 1
if (shiftKey = 0 and kstate = "U")
editfolder = 1
Loop, %0%
{
param := %A_Index%
SplitPath param, fileName, dirName, extension, fileNameNoExt
rawName = %fileNameNoExt%
gosub convert
if editFolder = 1
{
InputBox InputRawName, FileNanny, Name of the folder to create, , 320, 120, , , , , %rawName%
rawName = %InputRawName%
if ErrorLevel
ExitApp
}
dirToCreate = %dirName%\%rawName%
IfNotExist, %dirToCreate%
FileCreateDir %dirToCreate%.FileNanny
IfExist, %dirToCreate%
FileMoveDir %dirToCreate%, %dirToCreate%.FileNanny, 1
fileNewName = %rawName%.%extension%
FileMove %param%, %dirToCreate%.FileNanny\%fileNewName%
;; Similar files detection
if (similar = 1)
{
Loop %dirName%\*.*
{
Splitpath A_LoopFilename, , , ,similarNoExt
if (similarNoExt = rawName)
{
FileMove %dirName%\%A_LoopFilename%, %dirToCreate%.FileNanny\%A_LoopFilename%
}
}
}
;;
FileMoveDir %dirToCreate%.FileNanny, %dirToCreate%, 1
}
ExitApp
}
return
CreateGUI:
gui destroy
RegRead, regTest, HKEY_CLASSES_ROOT, *\shell\FileNanny
if strlen(regTest) = 0
{
button1Text = Add context menu item
button1Action = addCMI
}
else
{
button1Text = Remove context menu item
button1Action = remCMI
}
sendToFolder = %UserProfile%\SendTo
ifnotExist %sendToFolder%\filenanny.lnk
{
button2text = Add 'Send to' shortcut
button2action = addST
}
else
{
button2text = Remove 'Send to' shortcut
button2action = remST
}
Gui, Add, Button, x126 y225 w70 h30 gQuit, Quit
Gui, Add, Tab, x3 y5 w315 h260 vSelectedTab, Configuration|Options
Gui, Font, s9 w600
Gui tab, Configuration
Gui font, norm
Gui, Add, Button, x90 y65 w140 h30 g%button1Action% vCMIb, %button1Text%
Gui, Add, Button, x90 y125 w140 h30 g%button2Action% vSTb, %button2Text%
Gui tab, Options
if strlen(regTest) = 0
{
regTest = n/a
disabledOrNot = disabled
}
Gui, Add, text, x26 y59 w190 h20 vCurrentCMI, Current : %regTest%
Gui, Add, Button, x226 y55 w70 h20 %disabledOrNot% gchangeCMI vCMIc, Change
Gui, Add, GroupBox, x16 y35 w290 h50 , Context menu text
Gui, Add, CheckBox, x16 y95 w300 h30 vshiftKey gini, Holding the Shift key is required to modify `nfolder name before its creation
Gui, Add, GroupBox, x16 y135 w290 h50 , Convert these to spaces
Gui, Add, CheckBox, x30 y150 w50 h30 vconvDot gini, .
Gui, Add, CheckBox, x80 y150 w50 h30 vconvMinus gini, -
Gui, Add, CheckBox, x130 y150 w50 h30 vconvUnderscore gini, _
Gui, Add, CheckBox, x180 y150 w50 h30 vconvPercent gini, `%20
Gui, Add, CheckBox, x16 y195 w300 h30 vsimilar gini, Move similar files
Gui, Show, h270 w320, FileNanny
return
ini:
Gui submit, NoHide
Iniwrite %shiftKey%, %iniFile%, options, shiftkey
Iniwrite %convDot%, %iniFile%, convert, dots
Iniwrite %convMinus%, %iniFile%, convert, minus
Iniwrite %convUnderscore%, %iniFile%, convert, underscore
Iniwrite %convPercent%, %iniFile%, convert, percent
Iniwrite %similar%, %iniFile%, options, similarfiles
return
checkBoxes:
Iniread shiftKey, %iniFile%, options, shiftKey
Iniread convDot, %iniFile%, convert, dots
Iniread convMinus, %iniFile%, convert, minus
Iniread convUnderscore, %iniFile%, convert, underscore
Iniread convPercent, %iniFile%, convert, percent
Iniread similar, %iniFile%, options, similarfiles
Guicontrol ,,shiftKey, %shiftKey%
Guicontrol ,,convDot, %convDot%
Guicontrol ,,convMinus, %convMinus%
Guicontrol ,,convUnderscore, %convUnderscore%
Guicontrol ,,convPercent, %convPercent%
Guicontrol ,,similar, %similar%
return
convert:
Iniread convDot, %iniFile%, convert, dots
Iniread convMinus, %iniFile%, convert, minus
Iniread convUnderscore, %iniFile%, convert, underscore
Iniread convPercent, %iniFile%, convert, percent
if convDot = 1
StringReplace rawName, rawName, ., %A_SPACE%, A
if convMinus = 1
StringReplace rawName, rawName, -, %A_SPACE%, A
if convUnderscore = 1
StringReplace rawName, rawName, _, %A_SPACE%, A
if convPercent = 1
StringReplace rawName, rawName, `%20, %A_SPACE%, A
return
ChangeCMI:
RegRead, regTest, HKEY_CLASSES_ROOT, *\shell\FileNanny
transform,eperluette,chr,0x26
Inputbox newCMI, Enter new context menu text, Please choose the text that will appear in the context menu., , , , , , , , %regTest%
If ErrorLevel
{
return
}
else
{
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny, , %newCMI%
Guicontrol,, currentCMI, Current : %newCMI%
}
return
AddCMI:
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny, , FileNann&y !
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny\command, , "%A_ScriptFullPath%" "`%L"
Guicontrol,, CMIb, Remove context menu item
Guicontrol +gremCMI, CMIb
Guicontrol,, currentCMI, Current : FileNann&y !
Guicontrol enable, CMIc
return
RemCMI:
RegDelete HKEY_CLASSES_ROOT, *\shell\FileNanny
Guicontrol,, CMIb, Add context menu item
Guicontrol +gaddCMI, CMIb
Guicontrol,, currentCMI, Current : n/a
Guicontrol disable, CMIc
return
addST:
FileCreateShortcut, %A_ScriptFullPath%, %sendToFolder%\filenanny.lnk
Guicontrol,, STb, Remove 'Send to' shortcut
Guicontrol +gremST, STb
return
remST:
FileDelete, %sendToFolder%\filenanny.lnk
Guicontrol,, STb, Add 'Send to' shortcut
Guicontrol +gaddST, STb
return
Quit:
GuiClose:
GuiEscape:
ExitApp
return;; FileNanny
;; version 1.3.1
;; "Go to your room !"
;; by ak
#SingleInstance ignore
iniFile = %A_ScriptDir%\FileNanny.ini
if 0 = 0
{
gosub CreateGUI
gosub checkboxes
}
else
{
gosub iniVar
GetKeyState kstate, Shift
if (shiftKey = 1 and kstate = "D")
editFolder = 1
if (shiftKey = 0 and kstate = "U")
editfolder = 1
Loop, %0%
{
param := %A_Index%
SplitPath param, fileName, dirName, extension, fileNameNoExt
rawName = %fileNameNoExt%
gosub convert
if editFolder = 1
{
InputBox InputRawName, FileNanny, Name of the folder to create, , 320, 120, , , , , %rawName%
rawName = %InputRawName%
if ErrorLevel
ExitApp
}
dirToCreate = %dirName%\%rawName%
IfNotExist, %dirToCreate%
FileCreateDir %dirToCreate%.FileNanny
IfExist, %dirToCreate%
FileMoveDir %dirToCreate%, %dirToCreate%.FileNanny, 1
fileNewName = %rawName%.%extension%
FileMove %param%, %dirToCreate%.FileNanny\%fileNewName%
;; Similar files detection
if (similar = 1)
{
Loop %dirName%\*.*
{
Splitpath A_LoopFilename, , , ,similarNoExt
if (similarNoExt = rawName)
{
FileMove %dirName%\%A_LoopFilename%, %dirToCreate%.FileNanny\%A_LoopFilename%
}
}
}
;;
FileMoveDir %dirToCreate%.FileNanny, %dirToCreate%, 1
;; Autoarchive
Loop, parse, dirToCreate, \,
folderName = %A_LoopField%
if (autoarchive = 1)
FileMoveDir %dirToCreate%, %archivedir%\%folderName%, 1
}
ExitApp
}
return
CreateGUI:
gui destroy
RegRead, regTest, HKEY_CLASSES_ROOT, *\shell\FileNanny
if strlen(regTest) = 0
{
button1Text = Add context menu item
button1Action = addCMI
}
else
{
button1Text = Remove context menu item
button1Action = remCMI
}
sendToFolder = %UserProfile%\SendTo
ifnotExist %sendToFolder%\filenanny.lnk
{
button2text = Add 'Send to' shortcut
button2action = addST
}
else
{
button2text = Remove 'Send to' shortcut
button2action = remST
}
Gui, Add, Button, x126 y225 w70 h30 gQuit, Quit
Gui, Add, Tab, x3 y5 w315 h260 vSelectedTab, Configuration|Options|Autoarchive
Gui, Font, s9 w600
Gui tab, Configuration
Gui font, norm
Gui, Add, Button, x90 y65 w140 h30 g%button1Action% vCMIb, %button1Text%
Gui, Add, Button, x90 y125 w140 h30 g%button2Action% vSTb, %button2Text%
Gui tab, Options
if strlen(regTest) = 0
{
regTest = n/a
disabledOrNot = disabled
}
Gui, Add, text, x26 y59 w190 h20 vCurrentCMI, Current : %regTest%
Gui, Add, Button, x226 y55 w70 h20 %disabledOrNot% gchangeCMI vCMIc, Change
Gui, Add, GroupBox, x16 y35 w290 h50 , Context menu text
Gui, Add, CheckBox, x16 y95 w300 h30 vshiftKey gini, Holding the Shift key is required to modify `nfolder name before its creation
Gui, Add, GroupBox, x16 y135 w290 h50 , Convert these to spaces
Gui, Add, CheckBox, x30 y150 w50 h30 vconvDot gini, .
Gui, Add, CheckBox, x80 y150 w50 h30 vconvMinus gini, -
Gui, Add, CheckBox, x130 y150 w50 h30 vconvUnderscore gini, _
Gui, Add, CheckBox, x180 y150 w50 h30 vconvPercent gini, `%20
Gui, Add, CheckBox, x16 y195 w300 h30 vsimilar gini, Move similar files
Gui, Tab, AutoArchive
Gui, Add, CheckBox, x16 y35 w300 h30 vAutoArchive gini, Automatically move newly created folders to this folder :
Gui, Add, Edit, x16 y65 w170 h20 vArchiveDir,
Gui, Add, Button, x190 y63 w70 h26 gBrowse, Browse
Gui, Show, autosize, FileNanny
return
iniVar:
Iniread shiftKey, %iniFile%, options, shiftKey
Iniread similar, %iniFile%, options, similarfiles
Iniread autoarchive, %iniFile%, autoarchive, enabled
Iniread archivedir, %iniFile%, autoarchive, archivedir
return
ini:
Gui submit, NoHide
Iniwrite %shiftKey%, %iniFile%, options, shiftkey
Iniwrite %convDot%, %iniFile%, convert, dots
Iniwrite %convMinus%, %iniFile%, convert, minus
Iniwrite %convUnderscore%, %iniFile%, convert, underscore
Iniwrite %convPercent%, %iniFile%, convert, percent
Iniwrite %similar%, %iniFile%, options, similarfiles
Iniwrite %AutoArchive%, %iniFile%, autoarchive, enabled
Iniwrite %archivedir%, %inifile%, autoarchive, archivedir
return
checkBoxes:
Iniread shiftKey, %iniFile%, options, shiftKey
Iniread convDot, %iniFile%, convert, dots
Iniread convMinus, %iniFile%, convert, minus
Iniread convUnderscore, %iniFile%, convert, underscore
Iniread convPercent, %iniFile%, convert, percent
Iniread similar, %iniFile%, options, similarfiles
Iniread AutoArchive, %iniFile%, autoarchive, enabled
Iniread archivedir, %iniFile%, autoarchive, archivedir
Guicontrol ,,shiftKey, %shiftKey%
Guicontrol ,,convDot, %convDot%
Guicontrol ,,convMinus, %convMinus%
Guicontrol ,,convUnderscore, %convUnderscore%
Guicontrol ,,convPercent, %convPercent%
Guicontrol ,,similar, %similar%
Guicontrol ,,AutoArchive, %AutoArchive%
Guicontrol ,,archivedir, %archivedir%
return
convert:
Iniread convDot, %iniFile%, convert, dots
Iniread convMinus, %iniFile%, convert, minus
Iniread convUnderscore, %iniFile%, convert, underscore
Iniread convPercent, %iniFile%, convert, percent
if convDot = 1
StringReplace rawName, rawName, ., %A_SPACE%, A
if convMinus = 1
StringReplace rawName, rawName, -, %A_SPACE%, A
if convUnderscore = 1
StringReplace rawName, rawName, _, %A_SPACE%, A
if convPercent = 1
StringReplace rawName, rawName, `%20, %A_SPACE%, A
return
ChangeCMI:
RegRead, regTest, HKEY_CLASSES_ROOT, *\shell\FileNanny
transform,eperluette,chr,0x26
Inputbox newCMI, Enter new context menu text, Please choose the text that will appear in the context menu., , , , , , , , %regTest%
If ErrorLevel
{
return
}
else
{
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny, , %newCMI%
Guicontrol,, currentCMI, Current : %newCMI%
}
return
AddCMI:
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny, , FileNann&y !
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny\command, , "%A_ScriptFullPath%" "`%L"
Guicontrol,, CMIb, Remove context menu item
Guicontrol +gremCMI, CMIb
Guicontrol,, currentCMI, Current : FileNann&y !
Guicontrol enable, CMIc
return
RemCMI:
RegDelete HKEY_CLASSES_ROOT, *\shell\FileNanny
Guicontrol,, CMIb, Add context menu item
Guicontrol +gaddCMI, CMIb
Guicontrol,, currentCMI, Current : n/a
Guicontrol disable, CMIc
return
addST:
FileCreateShortcut, %A_ScriptFullPath%, %sendToFolder%\filenanny.lnk
Guicontrol,, STb, Remove 'Send to' shortcut
Guicontrol +gremST, STb
return
remST:
FileDelete, %sendToFolder%\filenanny.lnk
Guicontrol,, STb, Add 'Send to' shortcut
Guicontrol +gaddST, STb
return
Browse:
FileSelectFolder, ArchiveFolder, 3
GuiControl,, ArchiveDir, %ArchiveFolder%
Gosub ini
return
Quit:
GuiClose:
GuiEscape:
ExitApp
returnHere is FileNanny 1.4 : (see attachment in previous post)
Changelog :
- Added the Autoarchive feature to automatically move newly created folders to an archive folder.
nogojoe> i assume you use Windows Explorer ? I guess i could send a "F5" to the active window if this window is Explorer, but i don't really like the idea. The main reason is that the problem doesn't come from my code but from the fact that, obvisouly, the file explorer you use doesn't automatically refresh.





Are you sure this refresh thing only happens with the last versions ?






PostMessage, 0x111, 28931,,, ahk_id %ID%Original address: https://www.donationcoder.com/forum/index.php?topic=9357.0