ScriptTip#114:      EmailReplyGreeting Script
Synopsis:           Places greeting on Email replies.
Description:        Retrieves first name of sender and creates message
greeting heading of, "Hello [SenderName]," at the beginning of the reply.

Remarks:            When replying to a message, it is always cordial to
start the message with some type of greeting, such as "Hi," "Hello," "Hey
scumbucket," etc.  This script searches for the "From:..." line and
extracts the sender's first name, (or whatever the first word after the
"From:" word), and combines it with the word "Hello," and places it at the
top of your edit session.
A couple of things to take note of...
If you don't have your Email reader set to add original message in reply,
then this script will probably just print the word "Hello".  Also, it
specifically searches for the word "From:" within the message header text
that is placed into the reply text when that option is activated; if your
particular Email reader uses some other format to it's message headers,
you'll need to make the appropriate modifications within the search
function of this script.

Example:            If you're replying to an Email message from Festus
Dufus, hitting this script's hotkey as soon as you are in the edit session
will place the greeting of "Hello Festus," at the top of the reply, then
place you a couple of lines down so you can start typing your message.
If you wish to bestow some other greeting, just replace the "Hello" with
whatever you desire; "Hi", "Hey", "Drop dead", etc.

Compatibility:      JFW3.0 or higher.

--------------------------------------------------------------------------
1)  Enter whatever Email reader you use, then hit Insert+0 to launch the
Script Manager.
2)  Hit Control+End to reach the bottom of the file and whack Enter to
give yourself room.
3)  Type in, or cut and paste, the following script:

;Generates reply greeting in Email reader.
;6/26/99  Dennis Brown, [EMAIL PROTECTED]
script EmailReplyGreeting()
var                 ;Create a variable for
string SenderName  ; storing sender's name
Pause()             ;Toss a couple pause statements around.
PcCursor()                    ;Just to make sure focus is here!
;Now, find the word "From" within the original message header.
If(FindString(GetCurrentWindow(),"From:",s_top,s_restricted)) Then
NextWord()                    ;Ok, we found it, now get the next word,
let SenderName=GetWord()      ;and assign it to our created variable!
Pause()
{Control+Home}                ;Move back to top of message, and
PcCursor()
TypeString("Hello "+SenderName+",") ;type in our new greeting!
SayLine()                     ;Announce the new greeting, then
Pause()
{End}                         ;move to the end of the line, and
{Enter}                       ;electronically whack Enter a couple times!
{Enter}
Else                          ;What?  The word "From:" wasn't found?!!
Say("From: not found!",ot_string) ;Announce the bad news.
EndIf
EndScript

4)  While on a line within this script, hit Control+D to edit it's
properties, making sure the Script name is correct, and that the "Can be
assigned to key..." is checked.
Also fill in Synopsis: and Description: fields before Tabbing down to the
"Assign to..." field and hitting your hotkey for this script.
5)  Select Ok and once back in the editor, hit Control+S to compile the new
script.


Now, whenever you hit the key to reply to a message, and you are placed
into an edit field, hit the hotkey for this script before typing in your
reply.


Thanks,
Dennis Brown, [EMAIL PROTECTED]
June 26, 1999


-
Visit the jfw ml web page: http://jfw.cjb.net

Reply via email to