LoginSignup
3
3

More than 5 years have passed since last update.

Automatorでスクショ画像一括リサイズ

Last updated at Posted at 2016-11-19

リサイズをGUIでやりたい

よくmarkdownなどで貼る画像を一括リサイズしたい時がある.
コマンドラインをいちいち起動するのが面倒、
Automatorでスクリプト書くと便利だったのでメモ.

Automatorの作成

1. Serviceを選択

スクリーンショット 2016-11-19 20.11.28.png

2. シェルスクリプトをワークフローに

スクリーンショット 2016-11-19 20.11.58.png

3. パラメータの設定

イメージファイルを受け取り、検索対象はFinderに。
入力の引き渡しを「引数として」
スクリプトには下記を登録。
convertが登録されていない場合は、brew install imagemagick

count=0

for filename in "$@"
do
    count=$(( count + 1 ))
    extension="${filename##*.}"
    /usr/local/bin/convert -geometry 480x480 "$filename" $(dirname $filename)/${count}_480.${extension} 2>/tmp/automator.error
done

スクリーンショット 2016-11-19 20.15.05.png

スクリプト名は適当に Resize480 とした。

実行

スクショを複数選択して右クリック.
Resize480を選択.

スクリーンショット 2016-11-19 20.32.51.png

こんな感じで一気にリサイズできて便利.

スクリーンショット 2016-11-19 20.25.38.png

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3