#!/bin/sh

whoami=`basename $0`

if [ $# != 1 ]; then
   echo "Usage: $whoami filename" 1>&2
   echo -n "  \`filename' is the name of the file " 1>&2
   echo "to contain the Macintosh image." 1>&2
   exit 1
fi

filename=$1

cat << EOF 1>&2

Please click on the window you wish to convert to a Macintosh
image after the mouse cursor turns into a + symbol.  To convert
the whole screen, click on the background.

EOF

xwd | xwdtopnm | ppmtopict > $filename
if [ $? != 0 ]; then
   echo "Command failed." 1>&2
   exit 1
fi

cat << EOF 1>&2

Now ftp $filename to the Macintosh in binary mode with mac binary
DISABLED.  

To use ftp from the Macintosh, telnet to a sun and use command-f
to send ftp command.  When you are in ftp, you can cd to the
right place in the Macintosh filesystem as if it were a UNIX
machine.  For example: \`cd /Users/JDOE' will get you the JDOE
folder in the Users folder.  Names are not case sensitive.
Then, enter binary mode by typing the command \`bin'.  Finally,
send the file to the Macintosh by typing \`send $filename'.
When the transfer is complete, you can exit ftp with the \`quit'
command and then exit telnet.

Now that the file is on the Macintosh, invoke the FileEdit
program.  Once you have selected your file from within FileEdit,
use \`InfoEdit Files' from the \`File' menu to change its type
to PICT.  You can leave the owner as ????. 

Now you are ready to include the image in another document.  To
include this in a PowerPoint, you can use \`Paste From' from the
\`File' menu.

EOF

exit 0

intr:

echo "Command aborted."
