if you are attempting to write a string, and your string contains (
then to escape that character would simply be \(
if your variable is a string, then you need to change that variable so that those characters are escaped in this way. Perhaps before sending the variable to the write function you can someone search for those characters and precede them with the escape character \
|