Page 1 of 1

Dealing with Rounded Quotation Marks

Posted: Tue May 20, 2014 5:47 pm
by deeverd
Hello Forum,

Seven years ago, I had asked and received a workable answer to a simple problem, yet now that same problem has come back to haunt me...

All I'm trying to do is to replace rounded quotation marks in a document with plain "quote" marks and doing so through rtfText so it doesn't wipe out the other formatting styles. I have placed the code I'm using below and it looks totally correct to me but the rounded quotation marks are continuing to stay rounded. Any good ideas are definitely appreciated.

Code: Select all

on mouseUp
   
   ###################
   # UN-FANCY QUOTES #
   ###################
   
   set the cursor to busy
   
   get the rtfText of field "importField"--Step #1 & 2
   put it into tQuoteMarks
   
   
   replace numToChar(147) with quote in tQuoteMarks--Step #3 (rounded left quotations marks)
   replace numToChar(148) with quote in  tQuoteMarks----Step #3 (rounded right quotations marks)
   
   
   set the rtfText  of field "importField" to tQuoteMarks--Step#4
   
   answer information "All done. Your quotes are no longer fancy." titled "Fancy Quotes are Gone"
   wait 5 ticks
   
end mouseUp

Thanks in advance,
deeverd

Re: Dealing with Rounded Quotation Marks

Posted: Tue May 20, 2014 9:38 pm
by bn
Hi Deeverd,

I don't know nothing about RTF but looking at the rtfText it seems that rounded quotes are
\'D2
\'D3
replacing those in the rtfText with quote gives me regular quotes, I am on a Mac but that should be the same on Windows

here is a small stack that illustrates what I have done

Kind regards
Bernd

Re: Dealing with Rounded Quotation Marks

Posted: Tue May 20, 2014 10:14 pm
by deeverd
Hello Bernd,

Thank you very much! It's only been the past couple months that I have made myself become very familiar with HTML tags and a bit of CSS, but it hadn't dawned on me that RTF tags would be completely different. Actually, it also hadn't dawned on me that using "replace" this for that with RTF or HTML isn't always a literal replacement when it comes to certain symbols. I now understand.

I have just downloaded your stack and have no doubt that it answers my question perfectly.

Now, I need to do some research to understand RTF tags better.

Thanks again,
deeverd

BTW, I exited the forum to do a bit of searching and came up with the following excellent online resource for RTF tags:

http://www.biblioscape.com/rtf15_spec.htm

Hopefully, this will help anyone else seeking a good source of similar information.