How to remove the last character of a string if I know what the character is in AppleScript?
To have a portion of the string returned, the format would be:

set StringVariable2 to (characters n through n of StringVariable1) as string


n is the character number of the string starting at 1
as string is important or otherwise you get a list of single characters returned

Just make sure that whenever you parse any text, list or other item inside AppleScript to have text item delimiters at their default value (an empty list {}) unless you want to include those characters in the result as well.

In your example of removing the last character, it would be:

set StringVariable2 to (characters 1 through ((length of StringVariable1) - 1) of StringVariable1) as string