Вы можете сделать это с помощью простой AppleScript и утилита оболочки под названием глотка:
on open droppings
repeat with everyDrop in droppings
set originalFile to quoted form of POSIX path of (everyDrop as text)
tell application "Finder"
set originalName to everyDrop's name
set imageContainer to (everyDrop's container as text)
end tell
set reSizedName to "200W" & originalName
set outputPath to quoted form of POSIX path of (imageContainer & reSizedName)
do shell script "sips --resampleWidth 200 " & originalFile & " --out " & outputPath
end repeat
end open
on run
display dialog "Drop some Image Files to Re-size them all to 200 pixels wide" buttons {"Aye Aye"} default button "Aye Aye"
end run
Это сохраняет соотношение сторон исходного изображения, и просто повторно размеры ширину до 200 пикселей. Надеемся, вы сможете увидеть, где вы можете внести необходимые изменения для своего рабочего процесса.
Если вы хотите отказаться от папки изображений, а также отдельные файлы, попробуйте это как капельке:
on open droppings
repeat with everyDrop in droppings
if (info for everyDrop)'s folder is true then
tell application "Finder" to set allImageFiles to everyDrop's every file
repeat with eachFile in allImageFiles
my SetWidthTo200(eachFile)
end repeat
else
my SetWidthTo200(everyDrop)
end if
end repeat
end open
to SetWidthTo200(img)
set originalFile to quoted form of POSIX path of (img as text)
tell application "Finder"
set originalName to img's name
set imageContainer to (img's container as text)
end tell
set reSizedName to "200W" & originalName
set outputPath to quoted form of POSIX path of (imageContainer & reSizedName)
do shell script "sips --resampleWidth 200 " & originalFile & " --out " & outputPath
end SetWidthTo200
on run
display dialog "Drop some Image Files to Re-size them all to 200 pixels wide" buttons {"Aye Aye"} default button "Aye Aye"
end run
Там до сих пор нет проверки ошибок или проверки, чтобы убедиться, что файлы действительно изображение файлы, поэтому имейте это в виду.
Вы имеете в виду изменение размера до указанной ширины, поддерживая соотношение сторон, r IGHT? – Droppy
Это можно сделать с помощью Applescript с Photoshop. У вас есть Photoshop? –
@ Droppy yep. правильно. – smithua