Sync Timestamps - Multiple Files - req. Script Reloader Mod.

Discuss and share scripts and script files...
Post Reply
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Sync Timestamps - Multiple Files - req. Script Reloader Mod.

Post by SkyFrontier »

Sometimes "backup here" leaves me with a bad taste in my mouth - in fact, I'd like it should be able to "sync files" and not just "copy newer/update existent" - but then it wouldn't be a "backup" function, right? :wink:
So when I have to copy/overwrite newer/older files but preserving timestamping of files, now I can:
1) make sure there are identical named files in the same sequential order on both panes;
2) make sure the SOURCE for timestamping is in the inactive pane (it/they will be base, so the TARGET files will be naturally at the opposite, active pane);
3) execute this script once via Scripting > Run Script...:

Code: Select all

"Sync Timestamps|:steps"
//This one will get selected file on inactive pane as base to clone its timestamp attribs (C/M/A)
//to currently selected, focused item on active pane.
//To do: multi-items support on both panes - sort of "sync timestamping". When I get the knowledge...
//To do: error checking: only one item allowed as source on inactive pane.
//v2: now, it clones timestamp to all selected items on active pane, if that is the case.

//   msg "This will use SOURCE as base to clone timestamps C/M/A into TARGET.<crlf>Is the SOURCE on inactive pane and TARGET file(s) on active pane?<crlf>If so, please click OK to continue.", 1, ;

   $target = getinfo("item");

   Focus("PI");

   $dateFormat = 'yyyy-mm-dd hh:nn:ss';
   $rC = report("{Created $dateFormat}",1);
   $rM = report("{Modified $dateFormat}",1);
   $rA = report("{Accessed $dateFormat}",1);

   focus("pi");

   timestamp m, "$rM";
   timestamp c, "$rC";
   timestamp a, "$rA";
//   status "Timestamping OK. Have a nice day!";
4) Then, use this at the address bar and enjoy the show (755 stands for "Run Script Again", more useful than I originally planned... 8) ):
Script Reloader Mod

Code: Select all

::#755; focus "Pi"; sendkeys'{down}'; focus "pI"; sendkeys'{down}'; focus a; sendkeys"{enter}";
4.1) Get your eyes away from the screen as the flashing factor may turn it irritating (or get your inactive pane's color the same as active);
5) When the script reaches the end of the list, remember to press ESC once or twice to make it shut.

-Yes, if you can provide a better idea, it'll be great! (getting rid of the flashing/storing source/target values in memory and dealing with files regardless of their position on list.)
EDIT: Users interested on this may also want to look at the Timestamping Suite.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply