Hi there,
I am a little new to presets in Filebot, and am looking for help in renaming a large collection of photos. I started with a basic preset that would use folder name and create an image order sequence in that given collection:
Then I looked to add information, when available in file metadata, like camera model and date photo taken:
Code: Select all
{folder.name} - {i.pad(3)}{" | $dt.format('yyyy-MM-dd')"}{" | $camera.model"}
This works perfectly for the camera model, but not for the date. I presume the $ does not work for dt, or that my syntax is incorrect, but I couldn't quite figure out what was wrong there. When I use this without the $ in front of dt.format, it works, but a huge % of my pictures don't contain date values for that call, and therefore no date value is put into the file name. I then came across a forum post below which detailed how to alternatively use date modified, presumably because this was a more accurate representation of when the photo was taken compared to OS date created (but this is using CLI which I am not confident in attempting at this time). I thought this was an even more elegant solution as I'd prefer to have a date in the file name - it's more important to me that
a date is there, whereas camera model is just optional added info. Is there an easy way to implement this in a one line preset like I've been working on? Many thanks in advance for any help anyone can provide here, and apologies if this has been answered elsewhere. I have been looking for other posts or guides to no avail.
Ideal format: [folder name] - [# in sequence] [ | date photo taken/modified] [ | camera model]
This way, the pipe separators are only injected when metadata values are found.
I lastly tried just plugging in that line into a preset, and it works, but I don't think I want to use the
new command (I quite frankly don't understand it or what it does).
Code: Select all
{folder.name} - {i.pad(3) } | {new Date(file.lastModified()).dateTimeString}{" | $camera.model"}
Forum post:
viewtopic.php?t=5879
