Subject: Re: [Name Mangler Talk] Renaming iPhone Photo Folders

From: Rob Griffiths <[email-masked]>
Date: Sat, 28 Mar 2020 07:50:02 -0700

On Mar 28, 2020, at 7:47 AM, Lukasz Wolejko-Wolejszo <[email-masked]> wrote:

> Instead if the 12 single Find replace steps i've used the advanced editor with that:

Very nice!

I try to stay away from Advanced mode when giving answers to others, as it can get complicated to explain, especially if they don't have some coding experience. But yes, that's very a nice solution using Advanced mode. (I was also trying to retain maximum flexibility, so I didn't think to simply toss out chunks of the filename—your way is much more efficient!)

regards;
-rob.

---

From: Lukasz Wolejko-Wolejszo <[email-masked]>
Date: Sat, 28 Mar 2020 07:47:07 -0700 (PDT)

Hey,

Thanks i was playing around a few hours and come to a similar solution, but 
this is great!

Instead if the 12 single Find replace steps i've used the advanced editor 
with that:

[find ". January 20" in <name> and replace with "-01-"]
[find ". February 20" in <name> and replace with "-02-"]
[find ". March 20" in <name> and replace with "-03-"]
[find ". April 20" in <name> and replace with "-04-"]
[find ". May 20" in <name> and replace with "-05-"]
[find ". June 20" in <name> and replace with "-06-"]
[find ". July 20" in <name> and replace with "-07-"]
[find ". August 20" in <name> and replace with "-08-"]
[find ". September 20" in <name> and replace with "-09-"]
[find ". October 20" in <name> and replace with "-10-"]
[find ". November 20" in <name> and replace with "-11-"]
[find ". December 20" in <name> and replace with "-12-"]
[find ", " in <name> and replace with "-"]
[find " " in <name> and replace with "."]

used then 

Find Replace 
(.*)-(.*)-(.*)-(.*)
$4$3-0$2_$1

(.*)-(.*)-(.*)
$3$2-0$1

And removed then the running -0 or - depending on length .. 

Thanks a lot for the help!

Am Samstag, 28. März 2020 15:31:18 UTC+1 schrieb Many Tricks:
>
> On Mar 28, 2020, at 4:57 AM, Lukasz Wolejko-Wolejszo <
> [email-masked] <javascript:>> wrote: 
>
> > With given examples 
> > Berlin, 9. January 2019 ->190109_Berlin 
> > 27. January 2019 -> 190127 
> > Home, 24. February 2019 -> 190224 
> > 
> > If there a chance to do this with a script? 
>
> There's a chance :) ... and it's a really ugly, long, somewhat complicated 
> solution, but it seems to work. I've attached the configuration here as a 
> zip file; download it, unzip, then double-click to open in Name Mangler. 
> Some notes about what's going on... 
>
> * The first 12 steps convert month names to month numbers, surrounded by 
> double hyphens (so they're easy to pick out later, when we need them). 
> NOTE: If you do not have full month names for each and every month, this 
> will break—it's matching the full literal name of each month. 
>
> * The next nine steps change single-digit days of the month to 
> double-digits. You had said to just use the month number followed by 0, but 
> this will break for any month that does have two digits. These steps take 
> care of that, replacing single-digit days with their double-digit 
> counterparts. NOTE: This relies on each and every day being immediately 
> followed by a period; if that's not the case, this will break. 
>
> * The next step moves the two-digit year to the front of the string. 
>
> * The next step moves the day of the month to the right spot, and gets rid 
> of the double hyphens. 
>
> * The next step moves the optional place to the right spot in the name. 
> NOTE: This relies on the presence of the comma immediately after the place 
> name; if that's not there, this will likely break. 
>
> * The final two steps change the space before the place name into an 
> underscore, and remove a comma that's been hanging around this whole time. 
>
> Hopefully, you can see there are a lot of opportunities for this action to 
> break—it's *very* reliant on folders being named exactly as you laid out in 
> your examples. If anything varies—the comma isn't there once, the period 
> after the day isn't there, etc., this is likely to not do what you want. 
>
> However, if the names are all as shown, it will work—as the attached 
> screenshot shows. 
>
> **** PLEASE **** test on a copy of your folders, just in case things go 
> horribly wrong! 
>
> regards; 
> -rob. 
>
> --------- 
>
>

---

From: Rob Griffiths <[email-masked]>
Date: Sat, 28 Mar 2020 07:31:15 -0700

> If there a chance to do this with a script?

There's a chance :) ... and it's a really ugly, long, somewhat complicated solution, but it seems to work. I've attached the configuration here as a zip file; download it, unzip, then double-click to open in Name Mangler. Some notes about what's going on...

* The first 12 steps convert month names to month numbers, surrounded by double hyphens (so they're easy to pick out later, when we need them). NOTE: If you do not have full month names for each and every month, this will break—it's matching the full literal name of each month.

* The next nine steps change single-digit days of the month to double-digits. You had said to just use the month number followed by 0, but this will break for any month that does have two digits. These steps take care of that, replacing single-digit days with their double-digit counterparts. NOTE: This relies on each and every day being immediately followed by a period; if that's not the case, this will break.

* The next step moves the day of the month to the right spot, and gets rid of the double hyphens.

* The next step moves the optional place to the right spot in the name. NOTE: This relies on the presence of the comma immediately after the place name; if that's not there, this will likely break.

* The final two steps change the space before the place name into an underscore, and remove a comma that's been hanging around this whole time.

Hopefully, you can see there are a lot of opportunities for this action to break—it's *very* reliant on folders being named exactly as you laid out in your examples. If anything varies—the comma isn't there once, the period after the day isn't there, etc., this is likely to not do what you want.

However, if the names are all as shown, it will work—as the attached screenshot shows.

**** PLEASE **** test on a copy of your folders, just in case things go horribly wrong!

regards;
-rob.

---------

---

From: Lukasz Wolejko-Wolejszo <[email-masked]>
Date: Sat, 28 Mar 2020 04:57:23 -0700 (PDT)

Hi together,

i'm using an iPhone and i'm saving manually my photos in the following 
folder structure

2018
2019

06-June

200603_Jims.Birthday

12-December

191224_Christmas.with.Family 

2020

01-January

200101_New.Year

The photos app on a Mac and iCloud are not a real solution for me case they 
are limited to space and possibilities.
So i'm using the photos app with the "Export Origital Unmodified ..." 
funcrion into the "moment folders.

Those have the following format

(Place, )[Day of month]. [Month] [YEAR] here are few examples

Berlin, 9. January 2019
27. January 2019
Home, 24. February 2019

Now i like to use NameMangler to rename the folders 

1. put the last two numbers from the year to the front
2. Replace Moth (writte) with Month number followed by zero
3. Add Day with out dot
4. Add Underscore and Place if available.

With given examples