Tag der Aufnahme als Titel für Bilder in iPhoto

Montag, 22 März 2010
0.0/5 Bewertung (0 Stimmen)
Beschreibung

Die Titel, die iPhoto für neu hinzugefügte Bilder vergibt, haben das etwas unpersönliche Format ”IMG_nnnn” (einer fortlaufenden Serie) der Kamera. Dieses AppleScript nimmt jetzt den Tag der Aufnahme (EXIF-Info, die iPhoto gut versteht) für den Namen des Bildes, mit dem Format ”yyy-nn-dd-hh.mm.ss”
Hier das Script:


tell application ”iPhoto”
-- activate -- bring iPhoto back to front
copy (my selected_images()) to these_images

if these_images is {} then error ”Please select some images before using this script.”
set thename to ””
set thepaths to ””
set thedates to ””
repeat with i from 1 to the count of these_images
set this_image to item i of these_images

--set this_file to the image path of this_image
set thename to thename & ”, ” & the title of this_image
--set thepaths to thepaths & the image path of this_image & ”, ”
set thedate to the date of this_image

set theyear to the year of thedate
set themonth to my format(the month of thedate as number)
set theday to my format(the day of thedate)
set theseconds to my format(the seconds of thedate)
set themins to my format(the minutes of thedate)
set thehours to my format(the hours of thedate)

set thetitle to theyear & ”-” & themonth & ”-” & ¬
theday & ”-” & thehours & ”.” & themins & ”.” & theseconds

--set thedates to thedates & thetitle & ”, ”
set the title of the item i of these_images to thetitle as string

end repeat

end tell
on selected_images()
tell application ”iPhoto”
try
set these_items to the selection
if the class of item 1 of these_items is album then error
return these_items
on error
return {}
end try
end tell
end selected_images
on format(thenumber)
if (thenumber as number) < 10 then
set res to ”0” & (thenumber as string)
else
set res to thenumber as string
end if
return res
end format

Kopieren Sie das Script in den ScriptEditor und sichern es anschließend als Script mit dedm Namen ”Fotos umbenennen” (oder wie auch immer) in |Library/Scripts/Applications/iPhoto (sollte einer der Ordner nicht existieren, müssen Sie ihn noch erzeugen). Stellen Sie ausserdem sicher, dass das ScriptMenü-Icon in der Menüleiste sichtbar ist (einzustellen unter 10.6 mit dem ScriptEditor und unter 10.5 mit AppleScript-Dienstprogramm). Wechseln Sie jetzt zu iPhoto und markieren Sie einige Bilder. Starten Sie nun das gesicherte Script aus dem AppleScript-Menü und ... die Namen der Bilder ändern sich zum jeweiligen Tag der Aufnahme.

Spezifikationen

Hits

1488

© by macjaner.ch | Powered by GoeGG-ArT.ch