Try using the find
command with the exec
switch to call your image conversion solution. Alternatively, instead of using the exec
switch, you could pipe the output of find
to xargs
. There is lots of information online about using find
. Here's one example from StackOverflow.
As far as the image conversion, I think that really depends on your requirements for speed and efficiency. If you've verified the process you described, and this is a one-time process, and it only takes seconds or minutes to run, then you're probably fine. On the other hand, if you need to do this frequently, then it might be worth investing the time to find a one-step conversion solution that takes less time than your current, two-pass solution.
Note that, instead of two passes, you may be able to pipe the output of sips
to pdfjoin
; however, that would require some investigation to verify.