DonationCoder.com Software > Finished Programs
DONE: Change (sub) folder(s) date based on newest/oldest file in the folder
dcwul62:
Thanks - Looks really nice!!
=
SetFolDateNewButton-Video-14022014 124745.wmv (5682.3 kB - downloaded 434 times.)
=
4wd:
Not being unusually thick on my part but ... why did the interface for SetFolDateFM show up?
It's called from within the script, (as long as you set the path correctly).
Or do you swap ini files around depending on what date, (oldest/newest/etc), you want to set?
dcwul62:
I don't know.
The script
==
--- Code: Text ---@script vbscriptOption Explicit Dim regex, file, folder, rencmd, sfdcmd, WshShell Function OnClick(ByRef ClickData) sfdcmd = "F:\Directory Opus\SetFolDateFM.exe" ' Full path to SetFolDateFM.exe command Set WshShell = CreateObject("WScript.Shell") DOpus.OutputString "--- SetFolDate ---" Set regex = New RegExp With regex .Pattern = "(.*?)(?:([-\s]\d{2}).*|\.\w+)$" ' Change the RegExp to what you want .IgnoreCase = true .Global = false End With sfdcmd = sfdcmd & " /r " & Q(ClickData.func.sourcetab.path) For Each file In ClickData.func.sourcetab.selected_files If Not file.is_dir Then Set folder = regex.Execute(file.name) If folder.Count = 1 Then rencmd = "Rename " & Q(file.name) & " TO " & Q(folder.Item(0).Submatches(0) + "\" + file.name) DOpus.OutputString file.name + "|" + folder.Item(0).Submatches(0) DOpus.OutputString rencmd DOpus.OutputString "--------" ClickData.func.command.RunCommand rencmd sfdcmd = sfdcmd & " " & Q(folder.Item(0).Submatches(0)) End If End If Next DOpus.OutputString sfdcmd WshShell.Run(sfdcmd)End Function Function Q(s) Q = """" & s & """"End Function
//
The .ini
[General]
Recurse=True
Age=1
DateLimit=False
IncFolders=True
FileDate=0
[Folder]
Modified=True
Created=False
Accessed=False
I also tried without ini,
makes no difference.
Does SetFolDate come up at yours then?
=
4wd:
Spaces ... I hate them.
Updated button.
4wd:
Part 2 - Actually, there is no part 2 since it's the DOpus 10 script up here and it works fine on my machines. Button is here, install it the same as here, and edit the path to dopusrt.exe.
Part 3 - Is this script here for DOpus 11. Button is here, install it the same as here - no editing required.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version