Есть задача: публикуя фото, вырезать из EXIF информацию об используемом фотоаппарате и объективе, сохранив сведения ISO, апертуру и выдержку.
Этот скрипт в AppleScript будет вызывать exiftool для каждого из перетянутых на иконку скрипта файлов:
property RemoveCameraInfo : "-Make=\"\" -model=\"\""
property RemoveLensInfo : "-Lens=\"\" -LensID=\"\" -FocalLength=\"\" -LensInfo=\"\" -LensSerialNumber=\"\" -LensModel=\"\""
property RemoveCameraInfo_label : "Remove Camera info"
property RemoveLensInfo_label : "Remove Lens info"
to EditEXIF(ImageFile, processOptions)
local scriptString
set scriptString to "exiftool -overwrite_original_in_place -P"
if processOptions contains {RemoveCameraInfo_label} then
set scriptString to scriptString & " " & RemoveCameraInfo
end if
if processOptions contains {RemoveLensInfo_label} then
set scriptString to scriptString & " " & RemoveLensInfo
end if
set scriptString to scriptString & " " & quoted form of POSIX path of ImageFile
do shell script scriptString
end EditEXIF
to setOptions()
return choose from list {RemoveCameraInfo_label, RemoveLensInfo_label} with title "set options" with prompt "Please select which types of record to remove:" OK button name "Next" with multiple selections allowed without empty selection allowed
end setOptions
on open ImageFIles
set processOptions to setOptions()
if processOptions is not false then
repeat with i in ImageFIles
EditEXIF(i, processOptions)
end repeat
end if
end open

Добавить комментарий