ZTree.com  | ZEN  | About...  

 Index   Back

[Release] Set file name to [yymmdd hhmmss dow] .* eg [091007 160905 Wed] .jpg   [Release]

By: Andrew Watson     Perth, Western Australia  
Date: Oct 07,2009 at 15:00

Over the years I have asked Kim for an option in Rename to include short (and long) day of week (dow) (and month) names in the file name. I even travelled all the way to Ft Lauderdale and asked him face to face but to no avail.

The reason I would like to have this option is so I can bulk name my photos [yymmdd hhmmss dow] Description.jpg, eg [081120 160905 Wed] Ft Lauderdale, Andrew ZEPulating in front of Kim.jpg, without having to do them in day batches.

We have been away on holidays staying with friends in the south of Western Australia. We felt like pate de foie gras geese, ie locked in a box and stuffed with food.

Normally, I name the photos every night but this time I didn't do that. I now have nearly two weeks worth of photos to name.

I could have done them in day batches but I remembered that a few days ago I had read about the Bulk Rename Utility.

http://www.bulkrenameutility.co.uk/Main_Intro.php

It has the scariest interface that I have ever seen.

[image]

However, there is a command line version:

http://www.bulkrenameutility.co.uk/Command.php

that can be downloaded from here:

http://www.bulkrenameutility.co.uk/Downloads/BRU_NoInstall.zip

I was inspired by Ian Binnie's recent post to write a ZTree Application Menu script to rename the photos how I want them in one go.

If you want to test it without renaming any files remove the /execute from the end of lines 07 and 12. The pause at line 14 will let you see the rename preview output. Once you are happy with the results insert /execute at the end of lines 07 and 12 and remove line 14.

What happens if there is more than one file with the same time stamp? For example, this can occur when you take a series of photos for a panorama. The FAT32 used on memory cards can only save timestamps with a 2 second granularity and it is easy to take 2 or 3 photos in 2 seconds.

The Bulk Rename Command utility renames the first file and then skips the remainder.

The second script below can then be run to name the remaining photos to [yymmdd hhmmss_1 dow] .* and so on.

I would like to automate this process but I've already spent too much time on it and I don't think it's going to happen often enough to warrant the effort. However, if some bright person out there can see how to do it without taking too much time or coding I would be delighted to use it.

The only tricky bit of the code was to realise that the BRC32 argument to insert the dow

/appenddate:M:s:::10:%a

has to be

/appenddate:M:s:::10:%%a

when run from the ZTree eXecute prompt and

/appenddate:M:s:::10:%%%%a

when run from the ZTree Application Menu.

How much do you want to bet that now I have written this script Kim will add this as a native feature?

Rename current file/tagged files to [yymmdd hhmmss dow] .* eg [091007 160905 Wed] .jpg
01 :: Requires: Bulk Rename Command utility BRC32.exe to be stored in #ZTTools directory
02 :: Source: http://www.bulkrenameutility.co.uk/Download.php
03 :: Written by: Andrew Watson 10 Oct 2009
04 SET ZTTagged=False
05 :: #ZTIfTagged SET ZTTagged=True
06 IF [%%ZTTagged%%]==[False] GOTO NoTag
07 :: #ZTTag #ZTTemp\~ZTTag.bat -f#ZTTools\BRC32.exe /pattern:"%4.%5" /removename /appenddate:M:P:::9 /insert:[:1 /insert:" ":8 /insert:" ":15 /appenddate:M:s:::10:%%%%a /insert:]:19 /insert:" ":20 /execute
08 CALL #ZTTemp\~ZTTag.bat
09 rem DEL #ZTTemp\~ZTTag.bat
10 GOTO End
11 :NoTag
12 #ZTTools\BRC32.exe /pattern:"%4.%5" /removename /appenddate:M:P:::9 /insert:[:1 /insert:" ":8 /insert:" ":15 /appenddate:M:S:::10:%%%%a /insert:]:19 /insert:" ":20 /execute
13 :End
14 pause


Rename current file/tagged files to [yymmdd hhmmss_1 dow] .* eg [091007 160905_1 Wed] .jpg
01 :: Requires: Bulk Rename Command utility BRC32.exe to be stored in #ZTTools directory
02 :: Source: http://www.bulkrenameutility.co.uk/Download.php
03 :: Written by: Andrew Watson 10 Oct 2009
04 SET ZTTagged=False
05 :: #ZTIfTagged SET ZTTagged=True
06 IF [%%ZTTagged%%]==[False] GOTO NoTag
07 :: #ZTTag #ZTTemp\~ZTTag.bat -f#ZTTools\BRC32.exe /pattern:"%4.%5" /removename /appenddate:M:P:::9 /insert:[:1 /insert:" ":8 /insert:_1:15 /insert:" ":17 /appenddate:M:s:::10:%%%%a /insert:]:21 /insert:" ":22 /execute
08 CALL #ZTTemp\~ZTTag.bat
09 rem DEL #ZTTemp\~ZTTag.bat
10 GOTO End
11 :NoTag
12 #ZTTools\BRC32.exe /pattern:"%4.%5" /removename /appenddate:M:P:::9 /insert:[:1 /insert:" ":8 /insert:_1:15 /insert:" ":17 /appenddate:M:s:::10:%%%%a /insert:]:21 /insert:" ":22 /execute
13 :End
14 pause


Andrew Watson

1,755 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 59 users online (0 registered, 59 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 1:19 pm UTC  |  Hits:62,407,312  (22,098 Today )
RSS Feed