ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > N.A.N.Y. 2010

pyrohacker

<< < (4/5) > >>

adi_barb:
Why is SubDiv famous?

SubDiv is famous because it is a simple tool that allows you to manage and organize folders content.  :Thmbsup:

scasplte2:
First off, thank you so much for this nifty program. I was wondering is there anyway to change the date SubDiv looks at to create the folders?
Specifically, I am trying to organize a bunch of files and I wrote a program to go into each subdirectory and move certain filetypes to a specified folder. However, this action seems to rewrite the Date Created metadata leaving the original Date untouched and it is this date that I would like to sort by.

pyrohacker:
I'm reviving this thread to ask for help. I have lost SubDiv, both source and executable. A user has expressed interest in finding it, and I'm hoping that someone still has some part of it.

My apologies for raising the dead. If anyone has the executable or source code for SubDiv — any version number — please either post it or send it to me (email visible on profile page).

Shades:
The version I have  (executable only, version 1.0.48) is sent to the mail address I found on the web page your profile links to. The mail address is hidden on your profile.

A "strange" way of cloud back up  :P

Andreasvb:
Hi, I got a slightly modded version of your code.

I used this before and thought I would sort my download-folder now, but it didn't work today (Windows 10).
Thought I would see if there was an update for it, and read that you lost it.

Also, I wanted only the year, so I put together a little bat script instead. :)

Used some bits from these 2 to get it working so it will not move any .bat:
http://stackoverflow.com/a/22222204 [Batch file to move file based on Month & Year on Date modified to folder with YYYY_MM]
http://stackoverflow.com/a/863627 [In a batch file, how do I delete all files NOT of a certain type]


--- Code: Visual Basic ---@echo offclschoice /c yn /t 10 /d n /m "move all files divided by year?"if errorlevel 2 goto stopfor %%f in ("%cd%\*") do if not %%~xf==.bat (  for /f "tokens=1 delims=- " %%a in ("%%~tf") do (    if not exist "%cd%\%%a" mkdir "%cd%\%%a"    move "%%~f" "%cd%\%%a"  ))clsecho all done!timeout 10:stopexit

Here's the code for your script (modded for YYYY-MM)

--- Code: Autohotkey ---/*SubDiv created by pyrohacker on the D.C. Forumas a NANY 2010 Entry.*/ #NoEnv#SingleInstance ForceSendMode InputSetWorkingDir %A_ScriptDir%Menu, TRAY, Icon,,, 1 ; Set up GUIs and variables Setup: Gui, DestroyGui, 2:DestroyGui, 3:Destroy Separator=%SeparatorSelection%Cleanup=%CleanupSetAt% FormatTime, CurrentYear,, yyyyFormatTime, CurrentMonth,, MMFormatTime, CurrentDay,, dd ; Create the settings dialogGui, 3:Add, Text,, Creates folders: Year && Months`n:: Andreasvb 2012 mod ::FormatTime, SmartDate,, yyyy - M - dGui, 3:Add, Text,, Please select a date separator:Gui, 3:Add, Radio, Checked%UnderscoreOn% vSeparatorSelection, Underscore ( _ )Gui, 3:Add, Radio, Checked%HyphenOn% y+0, Hyphen ( - )Gui, 3:Add, Radio, y+15 Group Checked, Update ModeGui, 3:Add, Radio, y+0 Disabled, Monitor ModeGui, 3:Add, Checkbox, y+10 %Recursive% vRecurseSetAt, Recursive subfoldersGui, 3:Add, Checkbox, y+5 %Cleanup% vCleanupSetAt, Delete empty foldersGui, 3:Add, Button, y+20 x20 w70 gSendSettings, ApplyGui, 3:Add, Button, x+15 w70 gActions, Cancel Start:Gui, 2:Destroy ; Create the Main Actions DialogGui, 2:Add, Button, vUpdate gSortNow h120 w120, Sort this folder nowGui, 2:Add, Button, vSettings gShowSettings x+0 h120 w120, Change settingsGui, 2:+ToolWindowGui, 2:Show, Center, SubDivPause On Actions:Pause OffGui, 3:HideGui, 2:Show, Center, SubDivPause On SortNow:Pause OffLoop %A_WorkingDir%\*, 0, %Recursive% ; Retrieve a list of files to be sorted        NewFiles = %NewFiles%%A_LoopFileName%`nUpdateFolders()StringTrimRight, SortTime, %A_Now%, 6if Separator = 1        UnderscoreSort()if Separator = 2        HyphenSort()if ErrorLevel = 0        GoSub ProblemsMsgBox Finished sorting %A_WorkingDir%!GoSub EndProg UpdateFolders(){global If (Cleanup == 1) { Loop, *, 2,{  Size = 0  Loop, %A_LoopFileName%\*, 1, 1  {    Size += %A_LoopFileSize%};MsgBox Size of %A_LoopFileName% is %A_LoopFileSize% bytes.If (Size < 1) {FileRecycle, %A_LoopFileName%} }  }Return} HyphenSort(){globalLoop PARSE, NewFiles, `n{        FileGetTime DateCreated, %A_LoopField%, C        FormatTime, YearCreated, %DateCreated%, yyyy        NowTime := SortTime        EnvSub, NowTime, %DateCreated%, Days        IfInString, A_LoopField, SubDiv                Continue                        FormatTime, FolderName, %DateCreated%, yyyy                        FileCreateDir %FolderName%        FileMove %A_LoopField%, %FolderName%        EverRun=1}Return} UnderscoreSort(){        global        Loop PARSE, NewFiles, `n        {                FileGetTime DateCreated, %A_LoopField%, C                FormatTime, YearCreated, %DateCreated%, yyyy                NowTime := SortTime                EnvSub, NowTime, %DateCreated%, Days                IfInString, A_LoopField, SubDiv                        Continue                                        FormatTime, FolderName, %DateCreated%, yyyy                                                FileCreateDir %FolderName%                FileMove %A_LoopField%, %FolderName%                EverRun=1        }        Return}  ShowSettings:Pause OffGui, 3:Show, Center, Settings Dialog:Pause On SendSettings:Gui, 3:Submit Separator=%SeparatorSelection%Cleanup=%CleanupSetAt%  if (RecurseSetAt = 1) and (RecurseWarning = 0) {        MsgBox, 4, Caution:, You have instructed SubDiv to sort all files in this folder, including files inside subfolders.`nDoing this will destroy the folder structures in the sorted directory.  Are you sure?RecurseWarning=1        IfMsgBox No                GoSub ShowSettings}  Recursive=%RecurseSetAt% Gui, 3:HideGosub Start Problems:MsgBox Unknown problems were encountered, but I can't say what...ExitApp 3GuiClose:Gui, 3:CancelreturnEndProg:GuiClose:2GuiClose:ExitApp

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version