Page 2 of 2

Re: Possible to create folders from file names?

Posted: 20 Oct 2024 19:59
by Schuller
Works perfect!
Thanks again

Re: Possible to create folders from file names?

Posted: 12 Nov 2024 07:04
by Schuller
When I create the folder from file, is it possible to have it so that it also duplicates not just the name and created date, but also the comments, tags and all the extra column data too from the file columns to the folder columns?

Re: Possible to create folders from file names?

Posted: 12 Nov 2024 09:25
by highend
Sure...

Code: Select all

    setting "BackgroundFileOps", 0;
    foreach($item, <get SelectedItemsPathNames>, <crlf>, "e") {
        if (exists($item) == 2) { continue; }

        $cDate    = filetime($item, "c");
        $newPath  = gpc($item, "path") . "\" . gpc($item, "base");
        $metadata = "";
        $types    = "tag|cmt|lbl|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16";
        foreach($type, $types) {
            $metadata .= tagitems($type, , $item) . "|";
        }
        $metadata = trim($metadata, "|", "R");

        moveto $newPath, $item, , 2, 2, 2, 1, 0, 0, 1, 0, 0;
        timestamp "c", $cDate, $newPath;

        // Move metadata as well
        if (regexmatches($metadata, "[^|]")) {
            $i = 1;
            foreach($entry, $metadata) {
                $md   = gettoken($metadata, $i, "|");
                $type = gettoken($types, $i, "|");
                if ($md != "") { tagitems($type, $md, $newPath); }
                $i++;
            }
        }
    }

Re: Possible to create folders from file names?

Posted: 13 Nov 2024 07:35
by Schuller
Works perfect!
Thanks