jupe wrote: ↑25 Oct 2021 04:03
Not sure I understand what you mean? Do you want to timestamp 1 random named mp4 in each selected folder with the timetamp of the files parent folder? (or vice versa) That is my best guess as to what you are asking, if that is so, then this would be one way to do it:
Code: Select all
$files = quicksearch("*.mp4 /lpd=1 /fn", <selitems |>);
foreach($file, $files, <crlf>) { timestamp , gpc($file, "path"), $file; }
If you aren't interested in timestamping and just want to know how to find 1 mp4 in each selected folder, then just use/mod the first line.
I needed to do the vice versa -timestamp the folder with the same date as the .mp4 inside it. I reversed the both $file and gpc parts, and It works as I needed now. Thanks
Another question If I may ask! My scenario/problem was that I have files (mp4,mov,mkv) and I wanted to give each file a parent folder. So I use this script to move each file to a folder with the same name as the file
foreach($item, <get SelectedItemsPathNames |>, , "e") {
moveto "<curpath>\" . gpc($item, "base"), $item, , 2;
}
Then I encountered the Modified date problem -I need to maintain it as the same as the file itself- and I fortunately found the solution here.
I wonder if there is a smart way to merge the two scripts together To the following job:
Move
any selected file (ex:txt,mp4,mp3,mov,flv,mkv,...) to a separated folder with the same name of the file and the same Modified/Created Date