SwiftAppsBavaria

← sName2Date

sName2Date Manual

What the app does

sName2Date looks for a date in the file name and writes it into the image, movie or audio file as the capture date; for PDFs and other files without a capture date, the app sets the creation and modification date. A capture date that is already there gets overwritten in the process — that is exactly what the app is for, because an export or a digitization usually carries the wrong date. In the list, the existing date appears after the name — for PDFs and similar files, the creation date — and the new one on the right.

If files that already have a capture date should stay untouched, you can change that in Settings.

The two checkboxes at the top of the window

At the top of the window there are two checkboxes, and they do not exclude one another. Write date into the file puts the date it found into the file itself as the capture date; where the format cannot hold one — a PDF, say, or a text file — the app sets the file's creation and modification date instead, and the check mark in the row is then orange instead of green. Convert file names brings the name into the ISO notation. Both together are the normal case; if only the second one is set, no file is opened and it is only renamed.

The third checkbox, Put date first, belongs to the renaming: it places the date at the start of the name instead of replacing it where it was found. It is greyed out as long as nothing is being renamed.

Loading files

There are three ways to get files into the list: the buttons at the top of the window, dragging onto the window, or the File menu — ⌘O chooses files, ⌘⇧O a folder. The line below the buttons says which folder is currently loaded.

With a folder, the subfolders come along as long as the checkbox next to it is ticked.

Notations that are detected

Date and time are detected in the common forms, such as 2024-01-15 10-30-00, IMG_20240115_103000, 2024-01-15, 2024 01 15, 15.01.2024, 15-01-2024 and 15012024. Two-digit years are completed. The names given by SwiftRename are read as well.

If a name contains several dates, the first one wins — in IMG_20240115_bearbeitet_2019-03-02 that is the capture, not the later note. A date with a time always takes precedence over one without.

When only month and year are in the name

If the name carries only a year and a month, such as 2016 04 Blomberg, April 2016 is read and the first day of the month is assumed. The row then says “(day assumed)”; the exact day can be filled in in the field on the right.

The month has to be written with two digits for this. In a name like Bild 2 2016 there is usually a serial number instead — and a date read wrongly would be worse than one not read at all.

Day or month first?

April 3 is written 4/3 in the United States and 3/4 in Britain — the same two numbers, the opposite meaning. With 15-03-2024 that makes no difference: there is no month 15, so the date is unambiguous and is always read correctly. Only when both numbers could be a month, as in 03-05-2024, does it have to be decided.

If such a file is in the list, an orange bar appears above it offering the choice between the two readings; the rows concerned are marked separately. The notation of your system region is preset. As long as no file is ambiguous there is nothing to choose — which is why the bar is not there then.

Time

If the name carries only a date, a time is assumed. You can change it in Settings.

12 noon is preset. That keeps the day from flipping over if the file later travels to another time zone. If the file name is changed too, the assumed time appears in it as well — name and capture date always say the same thing.

Setting the date by hand

On the right of every row there is a field with a date and time. What you enter there takes precedence over the date from the file name. That way even files whose names contain no date at all can be processed.

The arrow next to the field resets the row to the value from the file name.

A second date: when the content was created

Alongside the capture date, it is possible to record when the subject itself was created — for a photographed painting from 1650 that means 1650, not the day of the shot. The “Content date” switch at the top of the window shows the “Dated” column for this. It is hidden by default, because most files do not need one.

This can only be stored in JPEG, TIFF and HEIC. PNG and GIF hold the capture date alone, and so do movies; there the column shows a note instead of a field. The capture date itself is written by all of these formats.

Making file names consistent

If you want, the app replaces the date in the file name with the ISO notation including the time: 15.03.2024 Urlaub.jpg becomes 2024-03-15 12-00-00 Urlaub.jpg. That way the files sort by capture time in the Finder. Switch it on with the checkbox Convert file names at the top of the window; the new name then appears below the old one in the list.

If the name carries no date at all, the one set by hand is put in front. If the new name is already taken, a number is appended. ⌘Z takes the renaming back as well.

Undo

⌘Z takes a run back: the capture date and the creation and modification dates are then back at their previous values. ⌘⇧Z repeats it.

If the list is cleared or another folder is chosen, undo goes away — the app then no longer has access to the old files.

What gets changed

EXIF DateTimeOriginal and DateTimeDigitized are written, as well as TIFF DateTime; for movies and audio recordings, the creation date inside the container. The image data itself is left untouched — a JPEG is not recompressed.

All the same, make a backup before you process a large collection.

When a row does not turn green

A blue check mark means the format itself cannot hold the capture date — for HEIF, WebP and AVI the value is therefore stored in an XMP sidecar beside the file, which many photo apps read as well. An orange check mark means the capture date could not be written, but the file's creation and modification dates now carry the value — so the date is recorded, just in a different place. The row gives the reason. A red triangle means nothing at all could be written.

If a single file was chosen, the app may at first only work on that file, not in its folder — but renaming changes the folder entry. So after the run the app asks once for the folder; a folder further up is enough, and the access also applies after a restart. If anything remains unclear, the button in Settings under Diagnostics saves a log file of the past seven days.

← sName2Date