Hello everybody!
I am a new XYplorer user and I am trying it out, I have many personal files and folders with the creation date greater than their modification date this was because I copied the files without preserving their creation date.
To fix this a bit I am trying to compare the modification date and creation date of all my personal files to detect which ones they are and then copy the modification date into the creation date field.
I have tried to create some visual filters but without success trying with "dateC: > dateM: " without quotes but I don't know if I'm missing something.
I have read the help manual and searched the forum, but I can't figure out how to compare two selectors as this case is very exceptional.
Is it possible to create such a visual filter in XYplorer?
Thank!
How to compare two filter selectors e.g. "dateC: > dateM: "
-
- Posts: 3
- Joined: 03 Aug 2021 19:41
Re: How to compare two filter selectors e.g. "dateC: > dateM: "
You can automate the whole process...
Go into the folder where all these files and folders are and then copy the script and paste it into
Menu - Scripting - Run Script...
and hit the OK button
Go into the folder where all these files and folders are and then copy the script and paste it into
Menu - Scripting - Run Script...
and hit the OK button
Code: Select all
$items = quicksearch(, , , "sm");
$list = "";
foreach($item, $items, <crlf>, "e") {
$path = gettoken($item, 1, "|");
$dateM = gettoken($item, 3, "|");
$dateC = gettoken($item, 4, "|");
if (compare($dateC, $dateM, "d") == 1) {
$list .= $path . <crlf>;
}
}
$list = trim($list, <crlf>, "R");
if ($list) {
if (confirm("Change date for " . gettoken($list, "count", <crlf>) . " item(s)?")) {
timestamp "c", '*', $list, "m";
}
}
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 3
- Joined: 03 Aug 2021 19:41
Re: How to compare two filter selectors e.g. "dateC: > dateM: "
Wow! this works perfectly, it even changes the date without having to use third party programs, but just out of curiosity would it be possible to list, filter or display by name the items before modifying the date?
Thanks for your time
Thanks for your time
Re: How to compare two filter selectors e.g. "dateC: > dateM: "
Replace
with
Code: Select all
if ($list) {
if (confirm("Change date for " . gettoken($list, "count", <crlf>) . " item(s)?")) {
timestamp "c", '*', $list, "m";
}
}
Code: Select all
if ($list) {
tab("new");
paperfolder("Wrong created dates", $list);
if (confirm("Change date for " . gettoken($list, "count", <crlf>) . " item(s)?")) {
timestamp "c", '*', $list, "m";
}
}
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 3
- Joined: 03 Aug 2021 19:41
Re: How to compare two filter selectors e.g. "dateC: > dateM: "
Great! works like a charm!