Reorganize Photos into yyyy-mm folders

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
dtmoc
Posts: 1
Joined: 09 May 2026 20:43

Reorganize Photos into yyyy-mm folders

Post by dtmoc »

Hi All!

I'm pretty new with XYPlorer but did try to look around for a easy solution for this.
Saw varying options but none worked in v28.30.0600.

Kinda expected XYPlorer could do it since it does so much!

How can I the app so that reorganizes picture files, for instance, in folders named as YYYY-MM?
Ideally this would be by EXIF date - but a fallback (or alternative) to do by date created would be good.

Simplified example
photos\pic1
photos\pic2
photos\pic3 830
photos\pic4
etc

photos\2026-01\pic1
photos\2026-01\pic2
photos\2026-02\pic3
photos\2026-02\pic4
etc

What am I missing?
I tried some options in move but could not get separate folders.
Saw some script options but they did not work and I am not familiar enough to troubleshoot yet.

highend
Posts: 14923
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Reorganize Photos into yyyy-mm folders

Post by highend »

Select the files, execute the script...

Code: Select all

    end (get("countselected") == 0), "No file(s) selected, aborted!";

    setting "BackgroundFileOps", 0;
    $items = <get SelectedItemsPathNames>;
    foreach($item, $items, <crlf>, "e") {
        if (exists($item) != 1) { continue; } // Skip folders
        $path = gpc($item, "path");
        $date = property("#image.datetaken", $item);
        if (!$date) { $date = property("#date.c", $item); }
        $date = formatdate($date, "yyyy-mm");
        moveto "$path\$date", $item, , 2, 2, 4, 1, 0, 0, 1, 0, 0;
    }
    echo "Done...";
And no clue why "photos\pic3 830" should turn into "photos\2026-02\pic3"...
One of my scripts helped you out? Please donate via Paypal

Post Reply