Example of usage:
[guybrush@powerbook guybrush]$ cd photos
[guybrush@powerbook photos]$ preview *.jpg *.png
- Place the following code in the file preview:
#!/bin/sh # A simple bash script that uses Applescript to # open multiple files in Preview. For example: # "preview hello.png world.gif *.jpg" if [ -z "$*" ]; then echo "Usage: $0 [FILE(S)]" exit fi PWD=${PWD//\//:} for file in $*; do if [ -n "$FILES" ] then FILES="$FILES, \"$PWD:$file\"" else FILES="\"$PWD:$file\"" fi done; osascript<<EOF tell application "Preview" activate open {$FILES} end tell EOF - Make the script executable by typing chmod +x preview
- Copy the script to your bin directory for easy access: sudo cp preview /bin/preview
- Then execute it by typing: preview *.png
[robg adds: You can, of course, just type open *.jpg in the Terminal to sort of do the same thing. The main difference is that this script opens one preview window with a drawer; the open method opens a bunch of individual windows. This script worked fine for me on 10.3.3 in tcsh...]

