Ok... what am I doing wrong here?
I am trying to code a formula for a smarticon. This formula will add a signature to an email starting wherever the cursor is currently placed. So far, no problem. The twist is that I may want to click the button again in order to pick up a different tag line in the array. I'd like the formula to be smart enough to wipe out the old signature and replace it with a new one...
Here's the formula I have so far (and the code COULD use some cleanup, but I've been trying a lot of different things to no avail):
REM {Insert as many signature tag lines as you'd like};
TagLine := ("Funny Tag Line #1":
"Funny Tag Line #2":
"Funny Tag Line #3");
REM {Store the number of tags you are using, along with the number of @NewLine commands in your signature};
NumberOfTagLines := 3;
NumberOfNewLines := 9;
REM {Get the environment variable of the next tagline to use, or set it to one if it's never been set before};
NumberNextTag := @Environment(sigLastTagUsed);
NumberNextTag := @If(NumberNextTag = "";1;@TextToNumber(NumberNextTag));
REM {Increment the value by 1, or reset it to 1 if you've reached the end of your tags. Store it, too.};
NumberNextTagPlus1 := @If((NumberNextTag + 1) > NumberOfTagLines;1;NumberNextTag + 1);
@SetEnvironment(sigLastTagUsed;@Text(NumberNextTagPlus1));
REM {Remove the old signature before writing the new one. This will be blank the first time through...};
@ReplaceSubstring(@ThisName;Signature;"");
REM {Pick the next tag to use, build the signature field, and place it in the Body field};
ChosenTag := TagLine[NumberNextTag];
FIELD Signature := "";
FIELD Signature := Signature + @NewLine + @NewLine;
FIELD Signature := Signature + "___________________________" + @NewLine;
FIELD Signature := Signature + @Name([CN]; @UserName) + @NewLine;
FIELD Signature := Signature + "Your company name goes here" + @NewLine;
FIELD Signature := Signature + "Your email address goes here" + @NewLine;
FIELD Signature := Signature + "Your phone number goes here" + @NewLine;
FIELD Signature := Signature + @Name([Address821]; @UserName) + @NewLine;
FIELD Signature := Signature + ChosenTag + @NewLine;
FIELD Signature := Signature + "";
@Command([EditInsertText];Signature);
REM {Now reposition the cursor back at the top of the signature so that it can be run over again if necessary};
@For(loopCtr:= 1; loopCtr <= NumberOfNewLines; loopCtr := loopCtr + 1;
@Command([EditUp]))
The problem I have is that the Signature field doesn't seem to be accessible. It inserts with no problem, but I can't display it in a prompt statement. When I check the document fields after clicking the icon, the Signature field is out there in the document. I seem to be so close, but I'm tripping over something...
Any hints?


