Question

I am creating this service for Finder that will receive image files and pass to a shell command.

The idea is this:

  1. I select image files on finder.
  2. I right click and choose the service I am creating
  3. the service receives the files and passes to sips, so it will scale the images to a given size.

this is how I created it.

sips would run on terminal if I type

sips -z 750 1334 *.png   (or any other extension, including *.*)

I am hoping that $* would pass a list of arguments to sips, but this is not working.

How do I do that?

enter image description here

Was it helpful?

Solution

I found a following solution that works for me:

for f in "$@"; do
  sips -z 750 1334 "$f"
done

OTHER TIPS

You're looking for $@:

sips -z 750 1334 "$@"
Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top