home *** CD-ROM | disk | FTP | other *** search
- /***********************/
- /* Remind.rexx */
- /* 8/3/89 - Don Nafis */
- /***********************/
-
- /*
- This script beeps then displays and speaks a message (reminder).
- If the speak: handler is not mounted, it attempts to mount it,
- bypassing the spoken message if the mount fails.
-
- Usage:
- rx remind This is the message.
-
- While I've written this Rexx script to be used with NazCron, it
- will work just fine from any ARexx or Execute script.
-
- */
-
- /* Remove the comments below to trace this script. */
- /*--->trace results<---*/
-
- options failat 20
-
-
- /*
- * Make sure there is a reminder to be given.
- */
- arg saywhat
- if (saywhat == '') then
- exit 20
-
-
- /*
- * "wakeupcall" will be displayed as the window title and spoken
- * just before the message is spoken. Have it say whatever you
- * want. If your screen width is other than 640, change the value
- * below. Screenwidth is used to determine if the message will fit
- * on the screen as well as to center the message.
- */
- wakeupcall = "Just a Reminder"
- screenwidth = 640
-
-
- /*
- * Compute the width in pixels that we will need to fit onto the screen.
- * If it is greater than the screenwidth, just abort. Someone who needs
- * longer messages and has more time to spare is welcome to change
- * this to handle multiple line messages.
- */
- width = (max((length(wakeupcall)+7),(length(saywhat)+8)) * 8);
- if ((screenwidth-width) < 3) then
- exit 20
-
-
- address command
-
-
- /*
- * DisplayBeep and put the message into a little window.
- */
- call open('shell', 'con:'||(screenwidth-width)/2||'/50/'||width'/38/'||wakeupcall);
- call writeln('shell', '07'x);
- call writeln('shell',' '||saywhat);
-
-
- /*
- * If speak: has been mounted, go speak the message. If not,
- * attempt to mount speak:, speaking the message if successful.
- */
- handlers = showlist('h')
- if (index(handlers, "SPEAK") == 0) then
- do
- 'mount speak:'
- if (rc == 0) then
- call speakit();
- end
- else
- call speakit();
-
-
- /*
- * Give the user 2 seconds to read the message, then close the window.
- */
- call delay(100);
- call close('shell');
-
- exit 0
-
-
- /*
- * Speak the message in AmigaVoice. I've done it this way since it
- * is much more likely that your mountlist will have an entry for
- * the speak: handler and that the mount and echo commands will be available
- * in the current path than that the "say" command will still be in the
- * utilities drawer or that the utilities drawer will be designated in the
- * your path. You may prefer to change this procedure to use the say
- * command, since the say command gives you more control over all aspects
- * of the AmigaVoice. If you change this to use "say", you can remove the
- * speak: handler mount logic as well.
- */
- speakit: procedure expose wakeupcall saywhat
- 'echo >speak: "'||wakeupcall'"'
- 'echo >speak: "'||saywhat||'"'
- return 0
-