on run {input, parameters} set theFolder to item 1 of input as string set directory to POSIX path of theFolder tell application "Terminal" do script "cd \"" & directory & "\" ; " & "exiftool -b -preview:all -w .jpg -ext dng . -execute -overwrite_original_in_place -tagsfromfile %d%f.DNG -orientation -ext jpg ." & " ; " & "logout" end tell -- allow sufficient time for exiftool execution to complete repeat set earlierCheck to (info for directory with size) delay 1 set laterCheck to (info for directory with size) if earlierCheck = laterCheck then exit repeat end repeat return input end run