Mal nach AppleScript verschoben, dort sind Fragen zum Automator wohl besser aufgehoben.
Ergebnis 1 bis 10 von 10
- 15.01.2012, 19:28 #1Golden Delicious
Themenstarter
- Registriert
- 01.2012
- Beiträge
- 8
Automator & Exif Tool - Variablen Shell Script möglich Hallo liebe apfel-Community!
Ich fotografiere an einer DSLR mit manuellen Objektiven, dadurch fehlen in den EXIF-Informationen die Angaben zu Blende, Brennweite Objektiv. Mit Hilfe von Phil Harvey's ExifTool in Verbindung mit einer Automator-Aktion: Write Lens Make And Aperture habe ich das ganz gut in den Griff bekommen.
Wenn man nun mehrere manuelle Objektive besitzt, so würde mann für jedes Objektiv & für jede Blende sowie jede Brennweite jeweils eine Aktion benötigen, das wäre imho eine etwas unübersichtliche Angelegenheit. Daher habe ich mir die Frage gestellt, ob es möglich is mit nur einer Aktion pro Objektiv auszukommen? Hierfür wäre es nötig, das Automator ein Dialogfeld öffnet in welchem ich die Blende & die Brennweite eingeben müsste.
Ist so etwas möglich?
Hier mal der Code des Shell Scriptes:
Im Anhang ein Screenshot einer dieser Automator Aktionen.Code:for f in "$@" do exiftool -overwrite_original -Lens='Olympus Zuiko OM 50mm F1,8-16' -ApertureValue='1,8' -FNumber="1,8" -FocalLength='50' "$f" done
Vielleicht kann mir ja jemand helfen
Viele Grüße Hagbard13" MacBook Pro Late 2009 | 2,26 GHz Intel Core 2 Duo | 8 GB 1067 MHz DDR3 RAM
- 16.01.2012, 18:58 #2
Mod-Info.
- 17.01.2012, 11:44 #3
Hmm im Automator geht das zwar, ist mir persönlich aber vieeel zu kompliziert und irgendwas schwirrt mir im Kopf rum, dass es auch irgendwie buggy ist.
In Applescript ist sowas ganz einfach. Hier mal ein schnell zusammengeschustertes Beispiel:
Sollte, als Application gespeichert, sowohl Standalone als auch als Droplet funktionieren.Code:property lensMap : {{Lens:"Olypmus Zuiko OM 50mm F1,8 - 16", ApertureValue:"1,8", FNumber:"1,8", FocalLength:"50"}, ¬ {Lens:"another lens", ApertureValue:"1,8", FNumber:"1,8", FocalLength:"50"}, ¬ {Lens:"yet another lens", ApertureValue:"1,8", FNumber:"1,8", FocalLength:"50"}} on main(aliasList) repeat with aAlias in aliasList set quotedFilePosix to quoted form of (POSIX path of aAlias) set lensAttr to getLens(quotedFilePosix) set shCmd to ¬ "exiftool -overwrite_original -Lens=" & quoted form of (Lens of lensAttr) & space & ¬ "-ApertureValue=" & quoted form of (ApertureValue of lensAttr) & space & ¬ "-FNumber=" & quoted form of (FNumber of lensAttr) & space & ¬ "-FocalLength=" & quoted form of (FocalLength of lensAttr) & space & ¬ quotedFilePosix try do shell script shCmd on error e set alertMsg to ¬ "Error: " & e & return & return & ¬ "File: " & quotedFilePosix & return & return & ¬ "Command: " & shCmd display alert "Ooops… iFail." message alertMsg as warning buttons {"Continue", "Cancel"} default button 1 cancel button 2 end try end repeat end main on getLens(aFileName) set cflList to {} repeat with aItem in my lensMap set cflList to cflList & Lens of aItem end repeat set cflPrompt to "Choose a lens for file " & return & aFileName set chosenLens to (choose from list cflList with prompt cflPrompt) if chosenLens is false then ¬ display alert "Canceled by user" as warning buttons {"OK"} default button 1 cancel button 1 repeat with aItem in my lensMap tell aItem if (its Lens as string) = (chosenLens as string) then return aItem end tell end repeat end getLens on run set aliasList to (choose file with multiple selections allowed) main(aliasList) end run on open (droppedFiles) --droplet main(droppedFiles) end open
Mit exiftool habe ich es jedoch nicht getestet - hab ich nicht drauf.
Geändert von fyysh (17.01.2012 um 11:57 Uhr)
The cause of the problem is:
Don't worry; it's been deprecated.
The new one is worse.
- 17.01.2012, 12:01 #4
Hi fyysh!
was ist denn bitte "es" in "…dass es auch irgendwie buggy ist" ?
Ansonsten....
Ich hatte kurz überlegt, ob ich hier poste, als ich dieses Thema sah. Bei dem nächsten Crossposting, welches ich hier entdecke, werde ich es tun!
Die Frage ist schon in einem anderen Forum beantwortet worden und der TE hielt es leider nicht für nötig, den aktuellen Stand seiner Anfragen hier zu posten.

Gruß
- 17.01.2012, 12:04 #5
Hey Sedna.
Die Listen. Warst nicht du die das mal hier irgendwo gepostet hat?The cause of the problem is:
Don't worry; it's been deprecated.
The new one is worse.
- 17.01.2012, 12:15 #6
Ach ja... stimmt!
*grins
Gruß
- 17.01.2012, 12:23 #7
Haha aber durch deinen Hinweis auf den Thread in einem anderen Forum habe ich das mit den Brennweiten und so erst verstanden. Lol.
Ich fotografiere nicht.
Aber dann ist es noch einfacher.
Code:property lenseList : {¬ "Olypmus Zuiko OM 50mm F1,8 - 16", ¬ "another lens", ¬ "yet another lens"} property apertureValuesList : {"1,8", "2,5", "5,6"} property focalLengthList : {"30", "40", "50"} on main(aliasList) repeat with aAlias in aliasList set quotedFilePosix to quoted form of (POSIX path of aAlias) set lensName to getVal(quotedFilePosix, my lenseList, "lens name") set ApertureValue to getVal(quotedFilePosix, my apertureValuesList, "aperture value") set FocalLength to getVal(quotedFilePosix, my focalLengthList, "focal length") set shCmd to ¬ "echo exiftool -overwrite_original -Lens=" & quoted form of lensName & space & ¬ "-ApertureValue=" & quoted form of ApertureValue & space & ¬ "-FNumber=" & quoted form of ApertureValue & space & ¬ "-FocalLength=" & quoted form of FocalLength & space & ¬ quotedFilePosix try do shell script shCmd on error e set alertMsg to ¬ "Error: " & e & return & return & ¬ "File: " & quotedFilePosix & return & return & ¬ "Command: " & shCmd display alert "Ooops… iFail." message alertMsg as warning buttons {"Continue", "Cancel"} default button 1 cancel button 2 end try end repeat end main on getVal(fileName, valList, valType) set cflPrompt to "Choose a " & valType & " for file " & return & fileName set chosenVal to (choose from list valList with prompt cflPrompt) if chosenVal is false then ¬ display alert "Canceled by user" as warning buttons {"OK"} default button 1 cancel button 1 return (chosenVal as string) end getVal on run set aliasList to (choose file with multiple selections allowed) main(aliasList) end run on open (droppedFiles) --droplet main(droppedFiles) end openThe cause of the problem is:
Don't worry; it's been deprecated.
The new one is worse.
- 17.01.2012, 13:25 #8Golden Delicious
Themenstarter
- Registriert
- 01.2012
- Beiträge
- 8
Vielen Dank für Eure Antworten

JA ich habe denKardinalsfehler eines Crosspostings begangen, daran gibt es nichts zu beschönigen.
Ich hoffe Ihr könnt mir vergeben und gebt mir noch eine Chance in der apfeltalk-Welt
Mein Anliegen wurde zu meiner Zufriedenheit beantwortet.
Mir bleibt nur mich bei allen beteiligtien hier zu Entschuldigen das ich nicht eher dazu Stellung bezogen habe.
Die Zeit war etwas knapp um 2 Foren, die Fotografie selbst (ich wollte es ja auch ausprobieren) und Familie unter einen Hut zu bringen.
Sorry und nochmals vielen Dank
Gruß Hagbard13" MacBook Pro Late 2009 | 2,26 GHz Intel Core 2 Duo | 8 GB 1067 MHz DDR3 RAM
- 17.01.2012, 16:48 #9
Wer sich so lieb entschuldigt, dem kann man einfach nicht böse sein
- 17.01.2012, 17:14 #10Golden Delicious
Themenstarter
- Registriert
- 01.2012
- Beiträge
- 8


Zitieren

