Доработать Apple Script

500 руб. за проект • электронные деньги
02 декабря 2016, 10:05 • 1 отклик • 37 просмотров
Есть скрипт, который меняет соотношение сторон у картинки на 16:9, но в данный момент при запуске скрипта в Автоматоре - появляется окно выбора файла.

Нужно избавиться от этого окна выбора файла и чтобы можно было массово выделять файлы в Finder'e и через контекстное меню запускать скрипт, который массово изменит соотношение сторон (без показа этого окна выбора файла).

Сам скрипт:
set this_file to choose file without invisibles
try
tell application "Image Events"
-- start the Image Events application
launch
-- open the image file
set this_image to open this_file
-- get dimensions of the image
copy dimensions of this_image to {W, H}
-- determine the letterbox area
set crop_W to W
-- calcluate the 16:9 proportions
set crop_H to (W * 9) / 16
-- perform action
crop this_image to dimensions {crop_W, crop_H}
-- save the changes
save this_image with icon
-- purge the open image data
close this_image
end tell
on error error_message
display dialog error_message buttons {"Cancel"} default button 1
end try