topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 6:54 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

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

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
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
« Last Edit: February 11, 2014, 11:47 PM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member

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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
You need to learn a little VBScript :)

Panorama.jpgDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

For DOpus 11:

Code: Text [Select]
  1. @script vbscript
  2. Option Explicit
  3.  
  4. ' Original script by MrC
  5. ' http://resource.dopus.com/viewtopic.php?f=3&t=19704&start=20#p106752
  6. '
  7. ' Modified for DOpus 11
  8.  
  9. Dim file, strDateTime, attrcmd
  10.  
  11. ' 10 digits, dash, 4 digits space dd-mm-yyyy.pdf
  12. Dim reA
  13. Set reA = new RegExp
  14. reA.Pattern = "^\d{10}-\d{4} (\d{2})-(\d{2})-(\d{4})(?:.*?)$"
  15.  
  16. ' Date / Scan Date pattern: dd mm yyyy ddmmyyyy, with possible space or dash separators in Date
  17. Dim re0
  18. Set re0 = new RegExp
  19. re0.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})[-\s]+(\d{8})(?:.*?)$"
  20.  
  21. ' Date / Time pattern: dd mm yyyy hh mm ss, with possible space or dash separators
  22. Dim re1
  23. Set re1 = new RegExp
  24. re1.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})[-\s]+(\d{2})([-\s]?)(\d{2})\6(\d{2})(?:.*?)$"
  25.  
  26. ' Date pattern: dd mm yyyy, with possible space or dash separators
  27. Dim re2
  28. Set re2 = new RegExp
  29. re2.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})(?:.*)$"
  30.    
  31. ' Date / Time pattern: yyyy-mm-dd hh mm ss
  32. Dim re3
  33. Set re3 = new RegExp
  34. re3.Pattern = "^(?:.*?)[-\s]*(\d{4}([-\s]*)\d{2}\2\d{2})[-\s]+(\d{2})([-\s]?)(\d{2})\4(\d{2})(?:.*?)$"
  35.  
  36. ' Date pattern: yyyy-mm-dd
  37. Dim re4
  38. Set re4 = new RegExp
  39. re4.Pattern = "^(?:.*?)[-\s]*(\d{4}([-\s]*)\d{2}\2\d{2})(?:.*)$"
  40.  
  41. Dim reTime
  42. Set reTime = new RegExp
  43. reTime.Pattern = "^(?:.*?)\s(\d{2}):(\d{2}):(\d{2})(?:.*)$"
  44.  
  45. DOpus.OutputString "---- DateFromName ----"
  46. Function OnClick(ByRef ClickData)
  47.   For Each file In ClickData.func.sourcetab.selected
  48. '    If file.is_dir Then             ' --- Uncomment this and "End If" below if you only want it to act on folders
  49.       DOpus.OutputString Q(file.path & file.name) & "|" & file.modify_utc & "|" & file.modify
  50.       If (reA.Test(file.name)) Then
  51.         strDateTime = reA.Replace(file.name, "$3$2$1")  
  52.         strDateTime = strDateTime & " " & reTime.Replace(file.modify, "$1:$2:$3")
  53.         DOpus.OutputString "Date A  = " & strDateTime
  54.       ElseIf (re0.Test(file.name)) Then
  55.         strDateTime = re0.Replace(file.name, "$4$3$1")  
  56.         strDateTime = strDateTime & " " & reTime.Replace(file.modify, "$1:$2:$3")
  57.         DOpus.OutputString "Date 0  = " & strDateTime
  58.       ElseIf (re1.Test(file.name)) Then
  59.         strDateTime = re1.Replace(strFileName, "$4$3$1 $5:$7:$8")
  60.         DOpus.OutputString "Date 1  = " & strDateTime
  61.       ElseIf (re2.Test(file.name)) Then
  62.         strDateTime = re2.Replace(file.name, "$4$3$1")
  63.         strDateTime = strDateTime & " " & reTime.Replace(file.modify, "$1:$2:$3")
  64.         DOpus.OutputString "Date 2  = " & strDateTime
  65.       ElseIf (re3.Test(file.name)) Then
  66.         strDateTime = re3.Replace(file.name, "$1 $3:$5:$6")
  67.         DOpus.OutputString "Date 3  = " & strDateTime
  68.       ElseIf (re4.Test(file.name)) Then
  69.         strDateTime = re4.Replace(file.name, "$1")
  70.         strDateTime = strDateTime & " " & reTime.Replace(file.modify, "$1:$2:$3")
  71.         DOpus.OutputString "Date 4  = " & strDateTime
  72.       End If
  73.  
  74.       If (Not IsEmpty(strDateTime)) Then
  75.         DOpus.OutputString "New Date & Time: " & strDateTime
  76.         attrcmd = "SetAttr FILE=" & Q(file.path & file.name) & " MODIFIED=" & Q(strDateTime)
  77.         DOpus.OutputString attrcmd
  78.         ClickData.func.command.RunCommand attrcmd
  79.       End If
  80. '    End If      ' --- Uncomment to match "If file.is_dir Then" statement above
  81.   Next
  82. End Function
  83.  
  84. Function Q(s)
  85.   Q = """" & s & """"
  86. End Function


And the previous VBScript runs SetFolDateFM only on the newly created folders, not all of them.
« Last Edit: February 12, 2014, 06:59 AM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member

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.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder
=

=
SnagIt-12022014 154533.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder
=

Cud you guide me?
Opus v.10.5

=

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
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.

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: Text [Select]
  1. Rename PATTERN="*" TO="*"
  2. @script vbscript
  3. Option Explicit
  4. ' Original script by MrC
  5. ' http://resource.dopus.com/viewtopic.php?f=3&t=19704&hilit=setattr+modify&start=20#p106752
  6. '
  7. ' Modified to work (extraneous \ added to file paths).
  8. ' Added folder date change.
  9.  
  10. ' For information on the technique used in this button see:
  11. ' "Abusing" Rename Scripts to do other things with file info
  12. ' http://resource.dopus.com/viewtopic.php?t=8034
  13.  
  14. ' Change the path below if you haven't installed Opus to the default location:
  15. dim DOpusRTPath
  16. DOpusRTPath = "%ProgramFiles%\GPSoftware\Directory Opus\dopusrt.exe"
  17.  
  18. Dim Shell
  19. Set Shell = CreateObject("WScript.Shell")
  20.  
  21. Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)
  22.   Dim strDateTime
  23.   Dim strCommand
  24.   ' Set strNewName to an empty string so that Opus does not rename the file.
  25.   strNewName = ""
  26.  
  27.   ' 10 digits, dash, 4 digits space dd-mm-yyyy.pdf
  28.   Dim reA
  29.   Set reA = new RegExp
  30.   reA.Pattern = "^\d{10}-\d{4} (\d{2})-(\d{2})-(\d{4})(?:.*?)$"
  31.  
  32.   ' Date / Scan Date pattern: dd mm yyyy ddmmyyyy, with possible space or dash separators in Date
  33.   Dim re0
  34.   Set re0 = new RegExp
  35.   re0.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})[-\s]+(\d{8})(?:.*?)$"
  36.  
  37.   ' Date / Time pattern: dd mm yyyy hh mm ss, with possible space or dash separators
  38.   Dim re1
  39.   Set re1 = new RegExp
  40.   re1.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})[-\s]+(\d{2})([-\s]?)(\d{2})\6(\d{2})(?:.*?)$"
  41.  
  42.   ' Date pattern: dd mm yyyy, with possible space or dash separators
  43.   Dim re2
  44.   Set re2 = new RegExp
  45.   re2.Pattern = "^(?:.*?)[-\s]*(\d{2})([-\s]*)(\d{2})\2(\d{4})(?:.*)$"
  46.  
  47.   ' Date / Time pattern: yyyy-mm-dd hh mm ss
  48.   Dim re3
  49.   Set re3 = new RegExp
  50.   re3.Pattern = "^(?:.*?)[-\s]*(\d{4}([-\s]*)\d{2}\2\d{2})[-\s]+(\d{2})([-\s]?)(\d{2})\4(\d{2})(?:.*?)$"
  51.  
  52.   ' Date pattern: yyyy-mm-dd
  53.   Dim re4
  54.   Set re4 = new RegExp
  55.   re4.Pattern = "^(?:.*?)[-\s]*(\d{4}([-\s]*)\d{2}\2\d{2})(?:.*)$"
  56.  
  57.   If (reA.Test(strFileName)) Then
  58.     strDateTime = reA.Replace(strFileName, "$3$2$1")  
  59.     strDateTime = strDateTime & " " & GetFileModTime(strFilePath & strFileName, fIsFolder)
  60.     'DOpus.OutputString "Date A  = " & strDateTime
  61.   ElseIf (re0.Test(strFileName)) Then
  62.     strDateTime = re0.Replace(strFileName, "$4$3$1")  
  63.     strDateTime = strDateTime & " " & GetFileModTime(strFilePath & strFileName, fIsFolder)
  64.     'DOpus.OutputString "Date 0  = " & strDateTime
  65.   ElseIf (re1.Test(strFileName)) Then
  66.     strDateTime = re1.Replace(strFileName, "$4$3$1 $5:$7:$8")
  67.     'DOpus.OutputString "Date 1  = " & strDateTime
  68.   ElseIf (re2.Test(strFileName)) Then
  69.     strDateTime = re2.Replace(strFileName, "$4$3$1")
  70.     strDateTime = strDateTime & " " & GetFileModTime(strFilePath & strFileName, fIsFolder)
  71.     'DOpus.OutputString "Date 2  = " & strDateTime
  72.   ElseIf (re3.Test(strFileName)) Then
  73.     strDateTime = re3.Replace(strFileName, "$1 $3:$5:$6")
  74.     'DOpus.OutputString "Date 3  = " & strDateTime
  75.   ElseIf (re4.Test(strFileName)) Then
  76.     strDateTime = re4.Replace(strFileName, "$1")
  77.     strDateTime = strDateTime & " " & GetFileModTime(strFilePath & strFileName, fIsFolder)
  78.     'DOpus.OutputString "Date 4  = " & strDateTime
  79.   End If
  80.  
  81.   If (Not IsEmpty(strDateTime)) Then
  82.     'DOpus.OutputString "Set Date & Time  = " & strDateTime
  83.     strCommand = Q(DOpusRTPath) & " /cmd SetAttr FILE=" & Q(strFilePath & strFileName) & " MODIFIED=" & Q(strDateTime)
  84.     'DOpus.OutputString "CMD = " & strCommand
  85.     Shell.Run strCommand,0,true
  86.   End If
  87. End Function
  88.  
  89. Function GetFileModTime(filespec, isdir)
  90.   Dim fso, f, s
  91.   Set fso = CreateObject("Scripting.FileSystemObject")
  92.   If isdir Then
  93.     Set f= fso.GetFolder(filespec)
  94.   Else
  95.     Set f = fso.GetFile(filespec)
  96.   End If
  97.   s = split(f.DateLastModified, " ", -1, 1)
  98.   GetFileModTime = s(1)
  99. End Function
  100.  
  101. Function Q(s)
  102.   Q = """" & s & """"
  103. End Function

And it is not a Rename preset - see here.
« Last Edit: February 13, 2014, 11:44 PM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
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. 425x308 - viewed 1731 times.)
* Capture-13022014 153205.png (69.39 kB. 518x135 - viewed 1616 times.)

=
« Last Edit: February 13, 2014, 08:43 AM by dcwul62 »

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
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.
« Last Edit: February 14, 2014, 12:19 AM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
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:
=
SnagIt-14022014 072324.png
=

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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
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.

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.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

Replacement:
SnagIt-10022014 121328.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

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

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 :)

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
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.jpgDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

  • Open the Customise dialog in a DOpus lister.

2014-02-14 21_32_17.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

  • Right-click on a toolbar and select Paste.

2014-02-14 21_33_20.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

  • Bingo!  A new button.

2014-02-14 21_34_39.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

  • 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.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

  • 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.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

  • 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.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder

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

Part 2 later.
« Last Edit: February 14, 2014, 07:11 PM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
Thanks - Looks really nice!!

=
* SetFolDateNewButton-Video-14022014 124745.wmv (5682.3 kB - downloaded 433 times.)
=

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
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

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
I don't know.

The script
==

Code: Text [Select]
  1. @script vbscript
  2. Option Explicit
  3.  
  4. Dim regex, file, folder, rencmd, sfdcmd, WshShell
  5.  
  6. Function OnClick(ByRef ClickData)
  7.   sfdcmd = "F:\Directory Opus\SetFolDateFM.exe" ' Full path to SetFolDateFM.exe command
  8.  
  9.   Set WshShell = CreateObject("WScript.Shell")
  10.  
  11.   DOpus.OutputString "--- SetFolDate ---"
  12.   Set regex = New RegExp
  13.   With regex
  14.     .Pattern    = "(.*?)(?:([-\s]\d{2}).*|\.\w+)$" ' Change the RegExp to what you want
  15.     .IgnoreCase = true
  16.     .Global     = false
  17.   End With
  18.  
  19.   sfdcmd = sfdcmd & " /r " & Q(ClickData.func.sourcetab.path)
  20.   For Each file In ClickData.func.sourcetab.selected_files
  21.     If Not file.is_dir Then
  22.       Set folder = regex.Execute(file.name)
  23.       If folder.Count = 1 Then
  24.         rencmd = "Rename " & Q(file.name) & " TO " & Q(folder.Item(0).Submatches(0) + "\" + file.name)
  25.         DOpus.OutputString file.name + "|" + folder.Item(0).Submatches(0)
  26.         DOpus.OutputString rencmd
  27.         DOpus.OutputString "--------"
  28.         ClickData.func.command.RunCommand rencmd
  29.         sfdcmd = sfdcmd & " " & Q(folder.Item(0).Submatches(0))
  30.       End If
  31.     End If
  32.   Next
  33.   DOpus.OutputString sfdcmd
  34.   WshShell.Run(sfdcmd)
  35. End Function
  36.  
  37. Function Q(s)
  38.   Q = """" & s & """"
  39. 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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Spaces ... I hate them.

Updated button.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
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.

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member

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, 01:12 AM by dcwul62 »

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
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.
« Last Edit: February 15, 2014, 03:49 AM by 4wd »

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
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.

=
SnagIt-15022014 111435.pngDONE: Change (sub) folder(s) date based on newest/oldest file in the folder
=

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

[attachmini=#][/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
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
Corrections on 2 regex's:

* SnagIt-15022014 131529.png (15.1 kB. 472x149 - viewed 698 times.)


Corrections

=

=


4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
(.*?)(?:([-\s]\d[-\s\d]*\.\w+)|\.\w+)$

http://regexr.com?38a4t

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member

AMAZING !!

Fantastic, really!

Don't know what else to say.

Many many thanks indeed.

http://s528.photobuc...zps7ec18e0e.mp4.html

=
* SetFolDateNewButton-Amazing-16022014 090300.wmv (4668.88 kB - downloaded 451 times.)
=

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

Again, many thanks!

=

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
What are you going to do with all your spare time now?

 ;D

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
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:

=
SnagIt-04042014 163431.png
=

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

Thanks.

==

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

dcwul62

  • Supporting Member
  • Joined in 2013
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
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
  • **
  • default avatar
  • Posts: 336
    • View Profile
    • Donate to Member
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...

=