Wie können wir das Datum und die Uhrzeit für mehrere Fotos gleichzeitig auf denselben Wert setzen?
Sie kennen wahrscheinlich das Problem - zu den Familienschätzen gehören viele Fotoalben mit Bildern oder Diakästen mit Bildern aus der Zeit, bevor wir Digitalkameras hatten. Und wir möchten auf diese Fotos in Diaschauen auf dem Computer zugreifen können und scannen die Bilder. Dann haben sie aber leider das Datum des Tages, wo wir sie gescannt haben und nicht das Datum, wann das Foto ursprünglich aufgenommen worden ist.
Wir brauchen ein Kommando, mit dem wir für unsere gescannten Fotos, die alle ursprünglich am selben Tag aufgenommen worden sind, das Datum in Stapelverarbeitung auf diesen Tag setzen können, und zwar so, dass sie eine gewünschte Reihenfolge beibehalten, wenn wir sie in Fotos nach dem Aufnahmedatum sortieren. Im guten alten iPhoto gab es so ein Kommando, mit dem wir das Datum für Fotos in Stapelverarbeitung auf denselben Wert setzen konnten und die Reihenfolge blieb erhalten. Dieses Kommando fehlt leider in Fotos.
In Fotos gibt es zwar das Kommando "Bild > Datum und Uhrzeit anpassen", Dieses Kommando ist aber dafür gedacht, das Datum aller ausgewählten Bilder gleichzeitig um denselben Zeitunterschied zu verschieben. Wir können so das Datum korrigieren, wenn die Uhr in einer Kamera falsch eingestellt war, weil sie stehengeblieben ist, wenn die Batterie zu lange leer war. Das Kommando setzt das Datum aber nicht für die ausgewählten Bilder auf dasselbe Datum, sondern verschiebt die Daten nur für alle Bilder um dasselbe feste Zeitintervall, als wenn wir die Uhr umgestellt hätten.
Um das fehlende iPhoto Kommando für Fotos nachzubauen, habe ich mir für solche Fälle ein Apple Script geschrieben: das Script steht hier (die Beschreibung ist allerdings auf englisch): Script: Batch Change the Date and Time to a Fixed Date
Um es zu benutzen,
- kopiere den Code unten in ein neues Fenster in Script Editor.
- Dann sammele alle Fotos, die dasselbe Datum erhalten sollen, in Fotos in einem Album, aufsteigend in der Reihenfolge, wie sie nach Datum sortiert werden sollen. Dieses Album sollte auf der obersten Ebene der Alben sein, nicht in einem Ordner versteckt. Bei einigen älteren Systemversionen funktionieren die Skripte nicht gut, wenn die Fotos in Alben in Unterordnern ausgewählt werden, auch nicht in intelligenten Alben.
- Setze das Datum des ersten Bildes im Album auf das Datum, das alle Fotos erhalten sollen - mit "Bild > Datum und Uhrzeit anpassen". Achte darauf, dass das Foto am Anfang des Albums bleibt und nach der Änderung des Datums nicht umsortiert wird. falls das passieren sollte, ziehe das Foto zurück an den Anfang des Albums.
- Wähle alle Fotos im Album zusammen mit ⌘A aus und drücke in der Werkzeugleiste vom Scripteditor auf ▶️ "Run".
Scripteditor wird jetzt das Datum vom ersten Foto auf alle anderen ausgewählten Fotos kopieren, und dabei die Uhrzeit für jedes Foto gegenüber dem Vorgänger um eine Minute erhöhen, so dass die Fotos beim Sortieren nach der Uhrzeit ihre Reihenfolge behalten. Diese Zeit zwischen aufeinanderfolgenden Fotos kann im Skript in der ersten Zeile geändert werden. Setze timeIncrement auf 0, wenn das Datum für alle Bilder exakt identisch sein soll.
-- ✄ ✄ ✄ ab hier kopieren ✄ ✄ ✄ ✄
(* Batch change the time of selected photos all at once
How to use this script:
- Collect all photos you want to set to the same time in an album
- and sort them manually
- Adjust the time of the first of your batch of photos with
"Adjust Date and time" in Photos from the "Image" menu,
even if the time is correct
- Select first the photo with the adjusted date,
- the hold down the Shift key and select all photos you want
to set to the same date and time at once.
- You need to select at least two photos.
- Open this script and run it by pressing the "Run" button.
- The script will copy the date from the first image
and set all photos to the same date,
and step the date by adding the increment
given by the variable timeIncrement.
- The script will return the last date it changed
- if you save this script as an Application
you can add it to the Dock and run it from there
Note - for some photos it may not be possible to change the time,
then running "Adjust date and time" for all photos once may help.
Photos has a bug that displays timezones incorrectly,
so the results may look wrong,
if the photos have been taken in different timezones.
This script has been tested in Photos version 1.0 to 4.0,
with MacOS X 10.10.3 - macOS 14.5
© Léonie
*)
set timeIncrement to 1 -- the time increment in minutes
(* select at least 2 images in Photos *)
tell application "Photos"
activate
set imageSel to (get selection)
if (imageSel is {}) or (the length of imageSel < 2) then
error "Please select at least two images."
else
set first_image to item 1 of imageSel
set first_date to (the date of first_image) as date
repeat with i from 2 to count of imageSel
set next_image to item i of imageSel
set next_date to (the date of next_image) as date
set time_difference to (first_date - next_date) ¬
+ ((i - 1) * timeIncrement * minutes)
-- return time_difference -- testing
tell next_image
set the date of next_image to (next_date + time_difference) as date
end tell
end repeat
end if
return "Adjusted the date and time of " & (the length of imageSel) ¬
& " photos. The last date is " & ((the date of next_image) as date)
end tell