Batch Image Processing with User Input

I'm a professional photographer and I often need images processed and hate throwing them in Photoshop due to the time. I had considered creating folders for common sizes and hard coding the size value into hazel (650px, 700px, 750px, etc.) But that still doesn't work all the time and is a little tedious. I was able to build a shell script that pops up a window and asks for user input but it asks for input on each file, so 100 images requires 100 inputs. Very annoying.
Any suggestions on typing the number once and once it cycles through every image it's done and resets the input.
- Code: Select all
size="$(osascript -e 'Tell application "System Events" to display dialog "Size?" default answer ""' -e 'text returned of result' 2>/dev/null)"
if [ $? -ne 0 ]; then
# The user pressed Cancel
exit 1 # exit with an error status
elif [ -z "$size" ]; then
# The user left the project name blank
osascript -e 'Tell application "System Events" to display alert "You must enter a number; cancelling..." as warning'
exit 1 # exit with an error status
fi
sips -Z $size * "$1"
Any suggestions on typing the number once and once it cycles through every image it's done and resets the input.