Welcome Guest.   Make a donation to an author on the site April 20, 2014, 07:04:31 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 2 3 4 [5]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Change (sub) folder(s) date based on newest/oldest file in the folder  (Read 13050 times)
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #100 on: February 11, 2014, 10:59:47 PM »

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:06 PM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #101 on: February 11, 2014, 11:58:59 PM »


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.

=
Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #102 on: February 12, 2014, 06:48:38 AM »

You need to learn a little VBScript smiley



For DOpus 11:

Formatted for Generic Code with the GeSHI Syntax Highlighter [copy or print]
  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:34 AM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #103 on: February 12, 2014, 08:57:48 AM »


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

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.
=

=

=

=

Cud you guide me?
Opus v.10.5

=
Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #104 on: February 12, 2014, 08:19:50 PM »

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

Believe or not, there is a reason I wrote For DOPUS 11  Wink
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:

Formatted for Generic Code with the GeSHI Syntax Highlighter [copy or print]
  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:53 PM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #105 on: February 13, 2014, 08:37:17 AM »

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 (129.2 KB. 425x308 - viewed 166 times.)
* Capture-13022014 153205.png (69.39 KB. 518x135 - viewed 165 times.)

=

« Last Edit: February 13, 2014, 08:43:42 AM by dcwul62 » Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #106 on: February 13, 2014, 07:29:52 PM »

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:



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.

* DateFromName (DO11).7z (1.22 KB - downloaded 10 times.)
* DateFromName (DO10).7z (1.47 KB - downloaded 11 times.)
« Last Edit: February 14, 2014, 12:19:06 AM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #107 on: February 14, 2014, 12:32:55 AM »

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

=

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.


Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #108 on: February 14, 2014, 04:08:42 AM »

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:


Replacement:


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

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #109 on: February 14, 2014, 05:24:50 AM »

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.



  • Open the Customise dialog in a DOpus lister.



  • Right-click on a toolbar and select Paste.



  • Bingo!  A new button.



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



  • 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.



  • 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).



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

Part 2 later.

* SetFolDateFM.7z (0.95 KB - downloaded 11 times.)
« Last Edit: February 14, 2014, 07:11:41 PM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #110 on: February 14, 2014, 05:53:38 AM »

Thanks - Looks really nice!!

=
* SetFolDateNewButton-Video-14022014 124745.wmv (5682.3 KB - downloaded 18 times.)
=
Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #111 on: February 14, 2014, 06:00:49 AM »

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?
Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #112 on: February 14, 2014, 07:09:23 AM »

I don't know.

The script
==

Formatted for Generic Code with the GeSHI Syntax Highlighter [copy or print]
  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?

=
Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #113 on: February 14, 2014, 07:11:20 PM »

Spaces ... I hate them.

Updated button.
Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #114 on: February 14, 2014, 08:31:04 PM »

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.
Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #115 on: February 15, 2014, 01:06:37 AM »


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:11 AM by dcwul62 » Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #116 on: February 15, 2014, 03:40:17 AM »

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:



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



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:01 AM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #117 on: February 15, 2014, 04:23:10 AM »

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.

=

=

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

* Opus context menu items-15022014.txt

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.
=

=
Logged
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #118 on: February 15, 2014, 06:16:43 AM »

Corrections on 2 regex's:

* Opus context menu items-15022014.txt (1.52 KB - downloaded 12 times.)


Corrections

=

=

Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #119 on: February 15, 2014, 08:21:07 PM »

(.*?)(?:([-\s]\d[-\s\d]*\.\w+)|\.\w+)$

http://regexr.com?38a4t
Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #120 on: February 16, 2014, 02:16:08 AM »


AMAZING !!

Fantastic, really!

Don't know what else to say.

Many many thanks indeed.

http://s528.photobucket.c...0300_zps7ec18e0e.mp4.html

=
* SetFolDateNewButton-Amazing-16022014 090300.wmv (4668.88 KB - downloaded 13 times.)
=

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

Again, many thanks!

=
Logged
4wd
Supporting Member
**
Posts: 3,222



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #121 on: February 16, 2014, 03:51:28 AM »

What are you going to do with all your spare time now?

 Grin
Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
dcwul62
Supporting Member
**
Posts: 171

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #122 on: April 04, 2014, 09:36:58 AM »

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:

=

=

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:13 AM by dcwul62 » Logged
Pages: Prev 1 2 3 4 [5]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.174s | Server load: 0.08 ]