DONE: Change (sub) folder(s) date based on newest/oldest file in the folder - DonationCoder.com
Welcome Guest.   Make a donation to an author on the site July 04, 2015, 09:41:59 PM  *

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 [6]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Change (sub) folder(s) date based on newest/oldest file in the folder  (Read 27992 times)
4wd
Supporting Member
**
Posts: 3,882



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #125 on: May 13, 2015, 07:36:16 PM »

Am using this sooo many times.  Thmbsup

Perhaps I should of included that per use royalty routine ...


Glad you're getting some use out of it.  Wink
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #126 on: May 19, 2015, 02:55:30 AM »

I have been puzzling about the below quite regularly. Sofar I renamed/copied files to folders 'manually', i.e. naming folders myself, not using setfoldatefm.

I wonder if it can be included in setfoldate though, as it is something regularly occuring with many files.

example

This & that - SomeFileName and Some Text 1971 - 01 - 17052015 102910.png
This & that - SomeFileName and Some Text 1971 - 02 - 17052015 102510.png
This & that - SomeFileName and Some Text 1971 - 03 - 17052015 103059.png
This & that - SomeFileName and Some Text 1971 - 04 - 17052015 103410.png
This & that - SomeFileName and Some Text 1971-05-17052015 102910.png
This & that - SomeFileName and Some Text 1971-06-17052015 102510.png
This & that - SomeFileName and Some Text 1971-07-17052015 103059.png
This & that - SomeFileName and Some Text 1971-08-17052015 103410.png

to a folder
This & that - SomeFileName and Some Text 1971

I vainly tried to figure this out myself.

Hope there is an easy solution for this, but if it is too complex, please leave it as t is.
I will continue the 'manual way'.

thanks
-
Logged
4wd
Supporting Member
**
Posts: 3,882



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #127 on: May 19, 2015, 04:49:51 AM »

I'm not sure what you're trying to get at here since SetFolDate only affects the dates of folders, it has no effect on any other attribute nor does it have any effect on files.

Didn't this get answered in another thread?

I suggested using DOpus to rename them into new folders.

http://www.donationcoder....39651.msg369918#msg369918
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #128 on: May 19, 2015, 05:23:40 AM »

There are two methods...

1)
-


-

and

2)

-

-

I meant the method under nbr 2

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



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #129 on: May 19, 2015, 10:39:39 PM »

You're not talking about SetFolDate, you're talking about a script that incidentally calls it.

Still works fine here, what does the output log show?
« Last Edit: May 19, 2015, 10:53:01 PM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #130 on: May 19, 2015, 11:48:02 PM »


Often a screenshot explains things better.


===

====

The script used for the Opus button is as follows

==


Formatted for Visual Basic 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[-\s\d]*\.\w+)|\.\w+)$" ' Change the RegExp to what you want
  15.    '.Pattern    = "(.*?)(?:([-\s]\d{2}).*|\.\w+)$" ' Change the RegExp to what you want
  16.    .IgnoreCase = true
  17.    .Global     = false
  18.  End With
  19.  
  20.  sfdcmd = Q(sfdcmd) & " /r " & Q(ClickData.func.sourcetab.path)
  21.  For Each file In ClickData.func.sourcetab.selected_files
  22.    If Not file.is_dir Then
  23.      Set folder = regex.Execute(file.name)
  24.      If folder.Count = 1 Then
  25.        rencmd = "Rename " & Q(file.name) & " TO " & Q(folder.Item(0).Submatches(0) + "\" + file.name)
  26.        DOpus.OutputString file.name + "|" + folder.Item(0).Submatches(0)
  27.        DOpus.OutputString rencmd
  28.        DOpus.OutputString "--------"
  29.        ClickData.func.command.RunCommand rencmd
  30. sfdcmd = sfdcmd & " " & Q(folder.Item(0).Submatches(0))
  31.      End If
  32.    End If
  33.  Next
  34.  DOpus.OutputString sfdcmd
  35.  WshShell.Run(sfdcmd)
  36. End Function
  37.  
  38. Function Q(s)
  39.  Q = """" & s & """"
  40. End Function


I tried to mess around with the regex (line 14) but didn't how to solve this.
On and on I tried with Opus rename
fm:  bla bla
to: \1\\\2 
(that you suggested in earlier threads)
but a. I didn't know exactly what I was doing and b. it did not work out, so gave up on that one.

However, maybe.. what I am asking is simply impossible.

brgds
=

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



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #131 on: May 20, 2015, 12:19:36 AM »

^(.*?\d{4})(?:.*)
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #132 on: May 20, 2015, 12:26:25 AM »

Will the current regex still work then?


later...
I check, regretfully it doesn't.
will re-instate the previous regex
Formatted for Visual Basic with the GeSHI Syntax Highlighter [copy or print]
  1. "(.*?)(?:([-\s]\d[-\s\d]*\.\w+)|\.\w+)$"

=

=
« Last Edit: May 20, 2015, 12:59:15 AM by dcwul62 » Logged
4wd
Supporting Member
**
Posts: 3,882



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #133 on: May 20, 2015, 03:24:49 AM »

Have you thought of having more than one button since your file naming conventions are so diverse?
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #134 on: May 20, 2015, 06:18:50 AM »

Nope, right now, all the renames (except this 'new' one) cud be covered with the existing regex.
Logged
4wd
Supporting Member
**
Posts: 3,882



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #135 on: May 20, 2015, 07:36:23 AM »

Formatted for Text with the GeSHI Syntax Highlighter [copy or print]
  1. (.*?\d{4})(?:.*)|(.*?)(?:([-\s]\d[-\s\d]*\.\w+)|\.\w+)$

You'll have to modify the first part to make sure it doesn't match names that would fall under the second RegEx alternative.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #136 on: June 11, 2015, 12:59:37 AM »

Hello 4wd
a complicated one, I guess.
Today I restore a -lot- of subfolders. They got today's date of course.
No problem: I have this 'adjust timestamp' button
Opus: d:\Directory Opus\SetFolDateFM.exe {ss} {Os}

A lof of folders (maybe 80% of the 180) went fine and got the folderdates based on newest date in file.
My workaround is to go down the folders and then run the adjust timestamp on sub folders (or sub-sub folders).
SOmetimes it also works to run it a number of times, 3-4-5x
Each time I have to
select folder
click button
exec all

I don't know how this could be solved.
Fact is, in the end it is okay

Just checked on a folder containing some utility software, after the 6x time, everything was okay.

For me it is 99,9% on newest date.

Q:
1) maybe it is possible to have this as a parameter? i.e. I would then have a button that will perform redating on newest date by default (no need to click on Exec all)
2) Maybe there is a way to have this run multiple times? (e.g. 3 times)


I would then only need to click on a hotkey to have it run 3 times on a number of selected folders.

What do you think?

Best regards
-






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



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #137 on: June 12, 2015, 11:24:18 PM »

A lof of folders (maybe 80% of the 180) went fine and got the folderdates based on newest date in file.
My workaround is to go down the folders and then run the adjust timestamp on sub folders (or sub-sub folders).
SOmetimes it also works to run it a number of times, 3-4-5x
Each time I have to
select folder
click button
exec all

So, what I think you're trying to say is that the reason the folders didn't get adjusted was because they had no files within them?

Why don't you turn Recurse on?

You're going to have to zip up your folder/file structure and send it to me since I can't look at it without something to work on.  Use skwire's Zero Zipper or since you have DOpus you can use my method.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #138 on: June 13, 2015, 01:23:34 AM »

Recurse is on, of course, by default.

Imagine following scenario:

X:\Folder

Select folder, click on Adjust time stamp, newest date, recurse tagged.
exec all

Nothing happens, do it again, and again and maybe again.
After 2-3 times, in worst case after the 6the time, folder is adjusted correctly.

So, what I am telling is that sometimes, on individual folders, I need to run the same adjust timestamp routine a couple of times.
In the end it is successful, for sure.

I would like to avoid doing the same routine multiple times.

So...
Q: is it possible to have additional parameters that does
a) the redate based on newest file
b) basis recursive=on
c) no deselecting the folder (until I manually deselect it, e.g. moving down to another folder)
d) does the job 3x

for example something like:

d:\Directory Opus\SetFolDateFM.exe {ss} {Os} {N} {R} {3}
{N} newest
{R} Recursive
{3} 3 times

to be honest, i have no idea where the {ss}{Os}  parameters come from...

I would then use a hotkey to simply execute the job, without any additional clicks.

Hope you understand, then again. I don't know if it is complicated.

Best regards
==

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



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #139 on: June 13, 2015, 05:39:42 AM »

Imagination doesn't help me fix what may or may not be a problem, all that may be the problem is you have something running that is locking the folder while SetFolDate is running.

If you want it to run multiple times, change the DOpus button by adding the command multiple times with the @nodeselect modifier.

{ss} - need source path (short)
{Os} - need all selected (short)

They are DOpus External control codes used to pass arguments to programs.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #140 on: June 13, 2015, 09:48:00 AM »




I mean this...

=

=

=
* AdjustTimeStamp-13-06-2015 13-37-46.mp4 (1929.13 KB - downloaded 8 times.)
=

Wonder whether the button should read like this now

d:\Directory Opus\SetFolDateFM.exe {ss} {Os}
@nodeselect
d:\Directory Opus\SetFolDateFM.exe {ss} {Os}
@nodeselect
d:\Directory Opus\SetFolDateFM.exe {ss} {Os}
@nodeselect
d:\Directory Opus\SetFolDateFM.exe {ss} {Os}
@nodeselect

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



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #141 on: June 14, 2015, 03:25:39 AM »

You're going to have to zip up your folder/file structure and send it to me since I can't look at it without something to work on.  Use skwire's Zero Zipper or since you have DOpus you can use my method.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #142 on: June 14, 2015, 04:18:00 AM »


Hello again, pls find attached  zip file.
I have just created a sub sub sub folder structure with some test files.
I needed to click on the new 'multi timeadjust' button twice to get the date of the rootfolder corresponds with the news file in the folder (12-06-2015)

Hope you will see what I mean.
==

* testfiles.zip (5207.23 KB - downloaded 30 times.)
Logged
4wd
Supporting Member
**
Posts: 3,882



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #143 on: June 14, 2015, 08:08:40 AM »

Thanks but I didn't really need the contents of the files, just the file/folder tree structure.

I can see what's happening, the change isn't fully propagating up the tree when Include Folders is set.

I suspect this is due because I haven't taken into account the new date of the recently changed (sub)folder, ie. it's using the date it obtained when the tree was first read.

It's easier to see what's happening if you use a dual pane lister with a flat view of the folder structure on one side.

I'll have a play around with it.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
dcwul62
Supporting Member
**
Posts: 261

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #144 on: June 14, 2015, 08:53:24 AM »

Most probably you won't be able to read the files anyway. They are just for testing purposes.


Did you try it yourself? The redating, I mean.
If you are at the topfolder, likely you need to click on adjust timestamp about 5-6x
Maybe if the tree is less 'deep', say just 1 subfolder or 2 at best, then the adjust timestamp runs fine.

For me it is no problem to have separate 'multi-adjust timestamp' button.
However, I think what I suggested below (multiple rows and @nodeselect in between) is not the right way..??
Get a number of pop-ups and need to click "exec all' each time.

Anyway, let's wait and see.

If it is too complicated, if there is no solution, then forget it.

Thanks for all yr help sofar!

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



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #145 on: June 14, 2015, 07:57:35 PM »

Did you try it yourself? The redating, I mean.

Yes, this is how I could see what was happening  Wink

You could probably modify your post and remove the archive now, saves people downloading a lot of renamed executables.  smiley
Logged

I do not need to control my anger ... people just need to stop pissing me off!
4wd
Supporting Member
**
Posts: 3,882



"This could get messy ..."

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #146 on: July 01, 2015, 03:24:38 AM »

UPDATE: v0.3.1.5
Fixed: Wasn't properly migrating date when recursion was active.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
Pages: Prev 1 2 3 4 5 [6]   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.057s | Server load: 0.07 ]


Share on Facebook
submit to reddit