DonationCoder.com Software > Finished Programs
DONE: Change (sub) folder(s) date based on newest/oldest file in the folder
dcwul62:
Oh, by the way ... it is perfect for me now (Opus)
where needed I added:
---
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}
---
Without using this, i.e. whilst using SetFolDate in the 'normal' (conventional, non context menu way), it works fine as well.
Have not tested it with Total Commander (donot have that) and also I have not tested it with explorer.
Assume it will work fine with those as well.
=
best regards
=
4wd:
See later post.
Here's an exercise in DOpus scripting, (only tested on DOpus 11 - actually it only works on DOpus 11):
--- Code: Text ---@script vbscriptOption Explicit Dim regex, file, folder, rencmd, sfdcmd, WshShell Function OnClick(ByRef ClickData) sfdcmd = "%programfiles%\GPSoftware\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 = "^([^\.-]+).*" ' Change the RegExp to what you want .IgnoreCase = true .Global = false End With sfdcmd = Q(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
DONE: Change (sub) folder(s) date based on newest/oldest file in the folder
Get your RegExp correct and you can select every file and just hit the button.
BTW, you want to post your RegExp you're using on those commands?
Because I'm quite sure you could reduce the number commands you'd require.
eg. From this image here, you seem to be using 3 different commands presumably with RegExp Rename commands along these lines:
Rename REGEXP PATTERN "(.+)(-|\s)(\d{6}|\d{8}|\d{2}-\d{2}-\d{4})(-|\s)(\d{6})\.(.+)" TO \1\\\0
Whereas, a single command with the following RegEx should cover all 3 types of filenames:
Rename REGEXP PATTERN "^([^\.-]+).*" TO \1\\\0
DONE: Change (sub) folder(s) date based on newest/oldest file in the folder
dcwul62:
Up front: sorry for the delay. Watching Olympics yesterday :)
Currently I am still with the latest v10 of Opus, waiting for the release candidate or final, which will come soon I guess.
I have a number of items in my context menu, creating a Filenamed folder to copy or to move to.
For files with
date-time
seq.nbr-date-time
date only
seq.nbr-date
above files are often a number screenshots, e.g. of program settings, or actions, etc.
and for files without date
=
DONE: Change (sub) folder(s) date based on newest/oldest file in the folder
=
The regex things, they work fine.
SetFolDate works fine with the existing regex.
I tried with the other options, non-regex, but it did not work out there.
=
http://s528.photobucket.com/user/phwul/media/SetFolDate/SetFolDateNew-10022014120123_zpsbebae824.mp4.html
=
1st regex: Create Filenamed Folder to MOVE to... (Date+Time)
Rename REGEXP PATTERN "(.+)(-|\s)(\d{6}|\d{8}|\d{2}-\d{2}-\d{4})(-|\s)(\d{6})\.(.+)" TO \1\\\0
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}
2nd regex: Create Filenamed Folder to MOVE to... (##-Date+Time)
Rename REGEXP PATTERN "(.+)(-|\s)(\d{2}|\d{3})(-|\s)(\d{6}|\d{8}|\d{2}-\d{2}-\d{4})(-|\s)(\d{6})\.(.+)" TO \1\\\0
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}
3rd regex: Create Filenamed Folder to MOVE to... (Date Only)
Rename REGEXP PATTERN "(.+)(-|\s)(\d{6}|\d{8}|\d{2}-\d{2}-\d{4})\.(.+)" TO \1\\\0
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}
4th regex: Create Filenamed Folder to MOVE to... (##-Date Only)
Rename REGEXP PATTERN "(.+)(-|\s)(\d{2}|\d{3})(-|\s)(\d{6}|\d{8}|\d{2}-\d{2}-\d{4})\.(.+)" TO \1\\\0
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}
=
non-regex
1st one: Create Filenamed Folder to MOVE to...
Copy MOVE CREATEFOLDER "{dlgstringS|Name of Folder to move to...|{file$|noext}}"
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}
the
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}
does not work here...
I have not yet testen your vbscript.. cause I am not sure..
Do you suggest I create this in the rename panel?
Actually I donot want to have too many buttons, reason why it is in the context menu with me.
Personally I think context menu items are much 'easier to work with' than buttons.
Anyway..
thanks for yr help!
=
dcwul62:
In the above ( TO \1\\\0 ) the '\0' is the foldername.
can this be used as a variable?
I don't know... :(
together with set fn and select $fn , like in
http://resource.dopus.com/viewtopic.php?t=15624&p=82452
or
http://resource.dopus.com/viewtopic.php?p=46176
Ah well, as said, I don't know..
dcwul62:
By the way, do you know a way to batch update folderdates based on a date in the foldername?
Like:
FolderNameXYZ 10-02-2014 with folder modified date 01-12-2013
then folder modified date to be updated to 10-02-2014
This is a regular thing, sofar I always updated it manually using an attribute changer.
(requires a number of clicks and is one by one)
=
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version