#!/bin/bash echo "--" /bin/hostname echo ' tell application "Finder" try mount volume "/path/to/network" on error return "couldnt mount xserve" exit end try try set rawFile to POSIX file ("'$1'") as alias set destPath to POSIX file ("'$2'") as alias on error errText return "couldnt read files: " & errText exit end try end tell tell application "Adobe Photoshop CS2" try open rawFile showing dialogs never set myDoc to index of current document set myResult to save document myDoc as TIFF in destPath close myResult saving no on error errText return "error in photoshop: " & errText exit repeat end try end tell return "done" ' > /tmp/xgridapplescript chmod 644 /tmp/xgridapplescript echo '#!/usr/bin/expect spawn ssh xgrid@127.0.0.1 "/bin/hostname; osascript /tmp/xgridapplescript" expect { "continue*" { send -- "yes\r" expect { "assword*" { send -- "$argv\r" interact } } } "assword*" { send -- "$argv\r" interact } }' > /tmp/xgridscript chmod 700 /tmp/xgridscript /tmp/xgridscript $3 rm /tmp/xgridscript rm /tmp/xgridapplescript echo "---" # end of script