How do I, in a script, only operate on the currently selected text?  I'm trying to replace all characters in the lines between '< and '> and it works, sort of ...  If there is a selected region visible, the script works.  But if there is no selected region visible, the script operates on the last selected region, which is not at all what the user will expect.  Instead, the script ought to just operate on the line the cursor is presently on.

I tried getting some help on #vim on, but as soon as they heard I was doing this in cream, they lost all interest in helping.  Of course, I can reproduce the problem in pure vim, but I'm not sure if I come up with a solution in vim (assuming I can) whether it will work in cream or not, given the difference in how modes operate.