<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
<font size="2"><font face="Helvetica,sans-serif">I'm sure I must be
overlooking something simple - - - - What I'm trying to do is have a
text field that detects when the user presses the character "*", and
when they do, it replaces that "*" with a bitmap graphic.  (Using the
imageSource call).  <br>
<br>
I've got the below code which _almost_ does this, except that it
replaces all the astericks except the one that the user just pressed. 
The trick here is that the user can click and put the cursor anywhere
in the text field, so it's not like I can just add an "*" to the last
char of the field and swap it out.  I somehow need to find out the
position in the text field where the cursor is, and add the asterick,
and THEN run the "refreshnotes" handler.<br>
<br>
on keydown theKey<br>
  if theKey = "*" then<br>
    refreshnotes<br>
  end if<br>
  <br>
  pass keydown<br>
  <br>
end keydown<br>
<br>
<br>
on refreshnotes<br>
  put the number of lines in field "notes" into temp<br>
  repeat with x = 1 to temp<br>
    if line x of field "notes" contains "*" then<br>
      put the length of line x of field "notes" into linelength<br>
      repeat with y = 1 to linelength<br>
        if char y of line x of field notes = "*" then<br>
          set the imageSource of char y of line x of field "notes" to
"checkbox"<br>
        end if<br>
      end repeat<br>
    end if<br>
  end repeat<br>
end refreshnotes<br>
</font></font>
</body>
</html>