DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Last post Author Topic: DONE: Change (sub) folder(s) date based on newest/oldest file in the folder  (Read 187,587 times)

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
FolderNameXYZ 10-02-2014         with folder modified date 01-12-2013

then folder modified date to be updated to 10-02-2014

You could do it in DOpus using a Rename script but naturally you need to specify RegEx to get the info you want from the name ... also naturally, if the date format changes, you have to change the RegEx.


Luckily, someone has done it: Change modified date after filename
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: February 12, 2014, 05:47 AM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336

Regretfully, sofar I have not found any tool (renamers or attribute/date time tools), regex or whatever
that changes the modified date of a  folder  based on a date in the foldername.

=

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
You need to learn a little VBScript :)

Panorama.jpg

For DOpus 11:

Code: (generic)
@script vbscript
Option Explicit

' Original script by MrC
' http://resource.dopus.com/viewtopic.php?f=3&t=19704&start=20#p106752
'
' Modified for DOpus 11

Dim file, strDateTime, attrcmd

' 10 digits, dash, 4 digits space dd-mm-yyyy.pdf
Dim reA
Set reA = new RegExp
reA.Pattern = "^\d{10}-\d{4} (\d{2})-(\d{2})-(\d{4})(?:.*?)$"

' Date / Scan Date pattern: dd mm yyyy ddmmyyyy, with possible space or dash separators in Date
Dim re0
Set re0 = new RegExp
re0.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})[-\s]+(\d{8})(?:.*?)$"

' Date / Time pattern: dd mm yyyy hh mm ss, with possible space or dash separators
Dim re1
Set re1 = new RegExp
re1.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})[-\s]+(\d{2})([-\s]?)(\d{2})\6(\d{2})(?:.*?)$"

' Date pattern: dd mm yyyy, with possible space or dash separators
Dim re2
Set re2 = new RegExp
re2.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})(?:.*)$"
   
' Date / Time pattern: yyyy-mm-dd hh mm ss
Dim re3
Set re3 = new RegExp
re3.Pattern = "^(?:.*?)[-\s]*(\d{4}([-\s]*)\d{2}\2\d{2})[-\s]+(\d{2})([-\s]?)(\d{2})\4(\d{2})(?:.*?)$"

' Date pattern: yyyy-mm-dd
Dim re4
Set re4 = new RegExp
re4.Pattern = "^(?:.*?)[-\s]*(\d{4}([-\s]*)\d{2}\2\d{2})(?:.*)$"

Dim reTime
Set reTime = new RegExp
reTime.Pattern = "^(?:.*?)\s(\d{2}):(\d{2}):(\d{2})(?:.*)$"

DOpus.OutputString "---- DateFromName ----"
Function OnClick(ByRef ClickData)
  For Each file In ClickData.func.sourcetab.selected
'    If file.is_dir Then             ' --- Uncomment this and "End If" below if you only want it to act on folders
      DOpus.OutputString Q(file.path & file.name) & "|" & file.modify_utc & "|" & file.modify
      If (reA.Test(file.name)) Then
        strDateTime = reA.Replace(file.name, "$3$2$1")   
        strDateTime = strDateTime & " " & reTime.Replace(file.modify, "$1:$2:$3")
        DOpus.OutputString "Date A  = " & strDateTime
      ElseIf (re0.Test(file.name)) Then
        strDateTime = re0.Replace(file.name, "$4$3$1")   
        strDateTime = strDateTime & " " & reTime.Replace(file.modify, "$1:$2:$3")
        DOpus.OutputString "Date 0  = " & strDateTime
      ElseIf (re1.Test(file.name)) Then
        strDateTime = re1.Replace(strFileName, "$4$3$1 $5:$7:$8")
        DOpus.OutputString "Date 1  = " & strDateTime
      ElseIf (re2.Test(file.name)) Then
        strDateTime = re2.Replace(file.name, "$4$3$1")
        strDateTime = strDateTime & " " & reTime.Replace(file.modify, "$1:$2:$3")
        DOpus.OutputString "Date 2  = " & strDateTime
      ElseIf (re3.Test(file.name)) Then
        strDateTime = re3.Replace(file.name, "$1 $3:$5:$6")
        DOpus.OutputString "Date 3  = " & strDateTime
      ElseIf (re4.Test(file.name)) Then
        strDateTime = re4.Replace(file.name, "$1")
        strDateTime = strDateTime & " " & reTime.Replace(file.modify, "$1:$2:$3")
        DOpus.OutputString "Date 4  = " & strDateTime
      End If

      If (Not IsEmpty(strDateTime)) Then
        DOpus.OutputString "New Date & Time: " & strDateTime
	attrcmd = "SetAttr FILE=" & Q(file.path & file.name) & " MODIFIED=" & Q(strDateTime)
	DOpus.OutputString attrcmd
	ClickData.func.command.RunCommand attrcmd
      End If
'    End If      ' --- Uncomment to match "If file.is_dir Then" statement above
  Next
End Function

Function Q(s)
  Q = """" & s & """"
End Function


And the previous VBScript runs SetFolDateFM only on the newly created folders, not all of them.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: February 12, 2014, 12:59 PM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336

Sorry - I can't get it working.
Feel sad to say that....  :(

If the script is for a button, in Opus v10.x I need to add:
Rename PATTERN="*" TO="*"

as first line.
So:
Rename PATTERN="*" TO="*"
@script vbscript
Option Explicit
..etc.

Without that 1st line, I get an error.

In the Rename panel nothing happens.
=
SnagIt-12022014 155526.png
=

=
SnagIt-12022014 154533.png
=

Cud you guide me?
Opus v.10.5

=

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Sorry - I can't get it working.
Feel sad to say that....  :(

Believe or not, there is a reason I wrote For DOPUS 11  ;)
The methods and properties used in the script don't exist in DOpus 10.

Quote
If the script is for a button, in Opus v10.x I need to add:

It won't work in anything lower than DOpus 11 - I don't have DOpus 10 installed and like Innuendo, come the day DOpus 11 is up for sale some of my cash will be going their way.  Writing scripts is so much easier in DOpus 11 because a lot more information is easier to get at and use now.

For DOpus 10:

Code: (generic)
Rename PATTERN="*" TO="*"
@script vbscript
Option Explicit
' Original script by MrC
' http://resource.dopus.com/viewtopic.php?f=3&t=19704&hilit=setattr+modify&start=20#p106752
'
' Modified to work (extraneous \ added to file paths).
' Added folder date change.

' For information on the technique used in this button see:
' "Abusing" Rename Scripts to do other things with file info
' http://resource.dopus.com/viewtopic.php?t=8034

' Change the path below if you haven't installed Opus to the default location:
dim DOpusRTPath
DOpusRTPath = "%ProgramFiles%\GPSoftware\Directory Opus\dopusrt.exe"

Dim Shell
Set Shell = CreateObject("WScript.Shell")

Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)
  Dim strDateTime
  Dim strCommand
  ' Set strNewName to an empty string so that Opus does not rename the file.
  strNewName = ""

  ' 10 digits, dash, 4 digits space dd-mm-yyyy.pdf
  Dim reA
  Set reA = new RegExp
  reA.Pattern = "^\d{10}-\d{4} (\d{2})-(\d{2})-(\d{4})(?:.*?)$"

  ' Date / Scan Date pattern: dd mm yyyy ddmmyyyy, with possible space or dash separators in Date
  Dim re0
  Set re0 = new RegExp
  re0.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})[-\s]+(\d{8})(?:.*?)$"

  ' Date / Time pattern: dd mm yyyy hh mm ss, with possible space or dash separators
  Dim re1
  Set re1 = new RegExp
  re1.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})[-\s]+(\d{2})([-\s]?)(\d{2})\6(\d{2})(?:.*?)$"

  ' Date pattern: dd mm yyyy, with possible space or dash separators
  Dim re2
  Set re2 = new RegExp
  re2.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})(?:.*)$"
  
  ' Date / Time pattern: yyyy-mm-dd hh mm ss
  Dim re3
  Set re3 = new RegExp
  re3.Pattern = "^(?:.*?)[-\s]*(\d{4}([-\s]*)\d{2}\2\d{2})[-\s]+(\d{2})([-\s]?)(\d{2})\4(\d{2})(?:.*?)$"

  ' Date pattern: yyyy-mm-dd
  Dim re4
  Set re4 = new RegExp
  re4.Pattern = "^(?:.*?)[-\s]*(\d{4}([-\s]*)\d{2}\2\d{2})(?:.*)$"

  If (reA.Test(strFileName)) Then
    strDateTime = reA.Replace(strFileName, "$3$2$1")  
    strDateTime = strDateTime & " " & GetFileModTime(strFilePath & strFileName, fIsFolder)
    'DOpus.OutputString "Date A  = " & strDateTime
  ElseIf (re0.Test(strFileName)) Then
    strDateTime = re0.Replace(strFileName, "$4$3$1")  
    strDateTime = strDateTime & " " & GetFileModTime(strFilePath & strFileName, fIsFolder)
    'DOpus.OutputString "Date 0  = " & strDateTime
  ElseIf (re1.Test(strFileName)) Then
    strDateTime = re1.Replace(strFileName, "$4$3$1 $5:$7:$8")
    'DOpus.OutputString "Date 1  = " & strDateTime
  ElseIf (re2.Test(strFileName)) Then
    strDateTime = re2.Replace(strFileName, "$4$3$1")
    strDateTime = strDateTime & " " & GetFileModTime(strFilePath & strFileName, fIsFolder)
    'DOpus.OutputString "Date 2  = " & strDateTime
  ElseIf (re3.Test(strFileName)) Then
    strDateTime = re3.Replace(strFileName, "$1 $3:$5:$6")
    'DOpus.OutputString "Date 3  = " & strDateTime
  ElseIf (re4.Test(strFileName)) Then
    strDateTime = re4.Replace(strFileName, "$1")
    strDateTime = strDateTime & " " & GetFileModTime(strFilePath & strFileName, fIsFolder)
    'DOpus.OutputString "Date 4  = " & strDateTime
  End If
  
  If (Not IsEmpty(strDateTime)) Then
    'DOpus.OutputString "Set Date & Time  = " & strDateTime
    strCommand = Q(DOpusRTPath) & " /cmd SetAttr FILE=" & Q(strFilePath & strFileName) & " MODIFIED=" & Q(strDateTime)
    'DOpus.OutputString "CMD = " & strCommand
    Shell.Run strCommand,0,true
  End If
End Function

Function GetFileModTime(filespec, isdir)
  Dim fso, f, s
  Set fso = CreateObject("Scripting.FileSystemObject")
  If isdir Then
    Set f= fso.GetFolder(filespec)
  Else
    Set f = fso.GetFile(filespec)
  End If
  s = split(f.DateLastModified, " ", -1, 1)
  GetFileModTime = s(1)
End Function

Function Q(s)
  Q = """" & s & """"
End Function

And it is not a Rename preset - see here.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: February 14, 2014, 05:44 AM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
Tried the version for v10

got this error

//
Successfully initialized 'vbscript' engine
Script started successfully
Error at line 90, position 3
Kan het pad niet vinden  (unable to locate path)
Script error - script aborted
//

Installed v11 beta 7
created a new button
pasted your v11 code in it.

did not work
=
Capture-13022014 153139.png
Capture-13022014 153205.png
=

=
Capture-13022014 153139.png (129.2 KB)
Capture-13022014 153205.png (69.4 KB)

=
« Last Edit: February 13, 2014, 02:43 PM by dcwul62 »

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
pasted your v11 code in it.

First off, the V11 version as I posted it, does not contain the line: Rename "*" TO "*"
Your attached version does.

Secondly, are you setting the new button to Script Function as shown here for the SetFolDateFM script I posted.

The script has been tested in DOpus x64 v11b6 and b7, on Win8.1 x64 and XP x86.

Button code is attached - open it in a text editor, copy the text, then paste it into a toolbar while the Customise dialog is open, (right-click on a toolbar, paste).

I'll have a look at the DO10 version later but it worked OK in a VM running XP x86 and DOpus 10.5.4.0

EDIT: The DO10 version works fine on XP Pro SP3 x86 (both VM and real) and WHS2011 x64 using DOpus 10.5.4.0


With the RegEx rename commands you're using, you could replace all four with:

Create Filenamed Folder to MOVE to...
Rename REGEXP PATTERN "(.*?)(?:([-\s]\d{2}).*|\.\w+)$" TO \1\\\0
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}

(.*?)(?:([-\s]\d{2}).*|\.\w+)$   Match everything up until the first occurrence of two digits or the extension, whichever comes first, but don't capture what follows.

An example:

2014-02-14 16_55_20.jpg

So if you put that RegEx into the script back here, you could select every file and hit the button.

BTW, here's an online RegEx tester that's compatible with DOpus' version, (TR1 ECMAScript): RegExr
Here's the above expression sans leading capture group.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: February 14, 2014, 06:19 AM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
Thanks for all.
I feel verrry sorry to say, but I am a bit lost now...
Got a bit confused.

1. I have installed DO v11b7 x64

2. This is in my F:\Directory Opus folder:
=
[attach=#]
=

3. I have deleted the toolbar-button

4. Ini-file reads
[General]
Recurse=True
Age=1
DateLimit=False
IncFolders=True
FileDate=0
[Folder]
Modified=True
Created=False
Accessed=False

5.SetFolDate.exe is v0.3.1.4 (latest version)

==

Now, from here, so, more or less from scratch, what do I need to do ?

Thanks again!

p.s. I know about the regexr and all, but find-replace are limited to filenames only.
I have not found any tools that can modify folderdates based on dates in the foldernames.


4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
There were three parts to my previous post, I'll start from the last.

First things first - refer to this post by you.

... but find-replace are limited to filenames only.

I never said it wasn't.

Quote
I have not found any tools that can modify folderdates based on dates in the foldernames.

I never said that's what it did or that there was.

What I did say was you could replace the four RegEx commands you use now with just one - or in pictures:

Current:
SnagIt-10022014 121328orig.png

Replacement:
SnagIt-10022014 121328.png

Thus the four RegEx commands you use now could be replaced by just one, ie. from this:

Quote
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}

To this:

Create Filenamed Folder to MOVE to...
Rename REGEXP PATTERN "(.*?)(?:([-\s]\d{2}).*|\.\w+)$" TO \1\\\0
Select ALLDIRS
"F:\Directory Opus\SetFolDateFM.exe" /r {ss} {allfile}

It covers the formats you stated:

Files with:
date-time
seq.nbr-date-time
date  only
seq.nbr-date

Plus files without the above, ie. files with just an extension.

I'll go away and do some pictures for the next item on the agenda :)
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Continuing on with the SetFolDateFM script which carries on from the previous post, (as in "So if you put that RegEx into the script back here, you could select every file and hit the button.").

  • Download the attached button for DOpus, (BTW, at this point I'm only going to deal with DOpus 11).
  • Extract and open the XML file in notepad, Select All, then Copy.

2014-02-14 21_31_01.jpg

  • Open the Customise dialog in a DOpus lister.

2014-02-14 21_32_17.png

  • Right-click on a toolbar and select Paste.

2014-02-14 21_33_20.png

  • Bingo!  A new button.

2014-02-14 21_34_39.png

  • Double-click on the button and then edit the script so that it has the correct path to SetFolDateFM.exe

2014-02-14 21_38_01.png

  • OK out of the Button Editor and the Customise dialog.
  • Select some files, the script is using the RegEx from my previous post (.*?)(?:([-\s]\d{2}).*|\.\w+)$ - so you can select all your files.  It doesn't matter if some have date+time, seq+date+time, date, seq+date, or no date+time.
  • Press the button.

2014-02-14 21_49_04.png

  • The result, (it's copying the files' MODIFIED date/time to the newly created folders CREATED and MODIFIED date/time - because that's what SetFolDateFM.ini is set for).

2014-02-14 21_51_19.png

Try it on some test files first.  In theory, one button just replaced your four Drag'n'Drop menu items.

Part 2 later.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: February 15, 2014, 01:11 AM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
Thanks - Looks really nice!!

=
[attachurl=#]
=

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
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?
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
I don't know.

The script
==

Code: (generic)
@script vbscript
Option 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

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Spaces ... I hate them.

Updated button.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
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.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336

Tried to make a videoclip of it.

Hope you can view it.

http://s528.photobucket.com/user/phwul/media/SetFolDate/SetFolDateNewButton-Updated-15022014124745_zps8cbb9374.mp4.html

http://s528.photobucket.com/user/phwul/media/SetFolDate/SetFolDate-NewButton-Requiressmallcorrection-15022014075748_zps5499eb33.mp4.html


It is almost perfect, one tiny tiny little thing.

It does not (yet) handle weird filenames like these

SubFolder-02A - AnotherFileName-01061996.jpg
SubFolder-02A - SomeFileName-01-16112012 234654.jpg
SubSomeFolder-02B - SubFolder-02B - AnotherFileName-01061996.jpg

covered by:
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

But that aside, all works fine.

=
« Last Edit: February 15, 2014, 07:12 AM by dcwul62 »

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
It does not (yet) handle weird filenames like these

SubFolder-02A - AnotherFileName-01061996.jpg
SubFolder-02A - SomeFileName-01-16112012 234654.jpg
SubSomeFolder-02B - SubFolder-02B - AnotherFileName-01061996.jpg

Works here:

2014-02-15 20_38_55.png

Oddly enough, I wouldn't have thought your RegEx would pick up all three fillenames:

2014-02-15 20_42_40.png

What exactly is it supposed to look like because at the moment your RegEx doesn't work here and mine, apparently, doesn't work there.  No point saying it doesn't work if I have no idea what the finished product is supposed to look like.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: February 15, 2014, 09:49 AM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
The idea is that a foldername is created,named after a filename, with exception of:
date
date+time
seq.nbr+date
seq.nbr+date time
at the end of a filename.

=
[attachthumb=#]
=

in the attachment you see that I am using the old context menu items.

[attachmini=#]

Your button works find for all other items... really fine.
Only these ones are still posting a small problem I guess.

Thanks for yr patience.
=

=

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
Corrections on 2 regex's:

[attachurl=#]


Corrections

=
[attach=#]
=

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
(.*?)(?:([-\s]\d[-\s\d]*\.\w+)|\.\w+)$

http://regexr.com?38a4t
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336

AMAZING !!

Fantastic, really!

Don't know what else to say.

Many many thanks indeed.

http://s528.photobucket.com/user/phwul/media/SetFolDate/SetFolDateNewButton-Amazing-16022014090300_zps7ec18e0e.mp4.html

=
[attachurl=#]
=

Tried to capture in a video. Uploaded to Photobucket and here directly.
Donot know can best be viewed, quality wise.

Again, many thanks!

=

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
What are you going to do with all your spare time now?

;D
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
Hello again,

All of a sudden the button changed, it did not work anymore.

I am using
Adjust_Timestamp.ouc  14-10-2013
proceeded to install it as per the old instructions

button looks like:

=
[attach=#]
=

Cud you pls check?
Is it compatible with v.11 of Opus?

Thanks.

==

later...
found the issue
see pm
« Last Edit: April 05, 2014, 05:34 AM by dcwul62 »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
deleted..
when adding a .mp4 and clicking on it, it opens explorer.
will try to figure out how to do this later

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 336
SetFolDate
and
including the option to adjust folder timestamp (to oldest/newest file in folder)

Am using this sooo many times.  :Thmbsup:
Perfect tool, at least, that is what I feel.
Just wanted to add this comment, nothing more.

Actually, I wonder why this has not been included into Explorer by default...

=

Original address: https://www.donationcoder.com/forum/index.php?topic=35881.0