Add Hour and Minute to filename?

97 views
Skip to first unread message

wamblej

unread,
Aug 17, 2012, 10:58:26 PM8/17/12
to phoshar...@googlegroups.com
Is there any way to add hour {hh} and minute {mm} to the filename?  My original schema for naming files prior to iphoto was yyyy-mm-dd-hh-mm so that I would never get duplicates and I could tell when the picture was taken just from the file name.  I would love to be able to replicate this when I export from iphoto.  
This program is amazing and I am more than impressed.  I hope that work on it continues!  I am currently trying to use my first mac after having many pc's.  This program allows me to use iphoto on my mac and export and sync with my windows server every so often so that all changes made are synced there.   
I have one other question.  I had it create folders as yyyy-mm, but it duplicated that (probably based on multiple events from same year).  Is there a way to have it lump them all together in the one yyyy-mm folder instead of yyyy-mm_(1), (2), etc?  Thank you for any help with this.  This is a major help with my mac/pc network.  

Tilman

unread,
Aug 19, 2012, 12:59:56 AM8/19/12
to phoshar...@googlegroups.com
Adding hour and minute would be relatively easy. If you are up to editing Python code (all you need is a text editor), look for the function format_photo_name in the file tilutil/imageutils.py, and expand on the year, month, day fields.

Sorry, merging multiple events into a single folder is not supported. The thinking is more that you do all your organization in iPhoto, and Phoshare just replicates that.

Tilman

wamblej

unread,
Aug 19, 2012, 8:05:50 AM8/19/12
to phoshar...@googlegroups.com
I am starting to understand iphoto more and I have been able to combine many events and get less "duplicates" which is great.  
Unfortunately I don't know anything about editing/programming code, although I guess I could search for that file and try.  I'm more worried that I'd break what functionality I have now.   This program is really great and I can't afford to do that.  
I export from my mac to my Windows Home Server and this allows all my pc's/macs to see any changes.  

kizer

unread,
Sep 27, 2012, 4:55:40 PM9/27/12
to phoshar...@googlegroups.com
When you put your photos in your mac are you putting them in by Year-Month-Day-Time? I use an app that changes all my files into that format and when I put them in iPhoto I use the Bulk editor and tell it to change the title of every photo to the filename. That way every photo has a Title and File name that are the same. So when I export my images they all come out using the  Year-Month-Day-Time. I'm guessing PhoShare outputs every image baised on file title not the actual file name.

None the less that is what I've done to insure I don't have conflicts.

Jonathan Le Roux

unread,
Mar 14, 2015, 11:40:32 PM3/14/15
to phoshar...@googlegroups.com
I know this is an old post, but I also wanted to include hours/minutes/seconds in my templates.
As Tilman suggested, it's quite easy to modify the function format_photo_name, once you realize that photo.date is actually a datetime object (that can be seen from the function getappletime in applexml.py).
So it's just a matter of adding the time info lines under "if photo.date":
if photo.date:
        year = str(photo.date.year)
        month = str(photo.date.month).zfill(2)
        day = str(photo.date.day).zfill(2)
        hour = str(photo.date.hour).zfill(2)
        minute = str(photo.date.minute).zfill(2)
        second = str(photo.date.second).zfill(2)
    else:
        year = ''
        month = ''
        day = ''
        hour = ''
        minute = ''
        second = ''
and again in the name_template.format() call:
                                              ...     
                                              mm=month,
                                              dd=day,
                                              hh=hour,
                                              MM=minute,
                                              ss=second)

Save the file, launch phoshare, and that's it, you can now use {hh}/{MM}/{ss} in the file name templates.

Jonathan
Reply all
Reply to author
Forward
0 new messages