March 18, 200322 yr Newbies I am trying to write a script that will replace a text string within a certain field with an extended ASCI character. In this case, after migrating from a Mac enviroment to a PC environment, the original pie and delta symbols got converted to underscores and AE symbols. I have a script that will do a global find and replace, however I cannot get pie and delta symbols to insert from the calculation. It just returns P and D, respectively. The pie and delta symbols are shift+P and shift+D in the symbol font, but I know that script maker doesn't return formatted text unless copied and pasted. Anyone know any tricks around this? The field that needs these symbols, contains paragraphs of text, so the entire field must not be formatted with the symbol font, only the characters that need to be pies and deltas. I work in a law office and pie stands for plaintiff and delta stands for defendant. The attourney who uses these symbols will not accept anything else. I basically need to know a method to find every instance of a "_" and replace it with a "π" and also "
March 19, 200322 yr I'm not sure this will work. Can you get the characters in a regular font on Windows? For instance, I can press Shift-Option-P to get a capital pi symbol in most fonts. If you can do this, then create a global field with the contents of a capital pi symbol. Then use the Substitute function to replace all occurances of _ with the contents of that fields, as in Substitute( YourField, "_", gPi ). This can be done with either a looping script or a Replace Contents. The only other option I can think of is to see if there's a plugin that can help. Check out http://www.fmplugins.com Chuck
March 19, 200322 yr I do something similar. I used the web companion plugin to convert the high ascii into the ampersand cluster, where routine find & substitute commands can be used. Go to application preferences/plugins and enable the web companion. Then make a calculation field where the calculation is; External(Web-to-HTML, TextField) If TextField is you field containing the high asci, then this calculation will replace the
March 20, 200322 yr Author Newbies The problem here is that to get a pi and delta symbol, the actual text has to be formatted in the Symbol font. Filemaker does not seem to use extended ASCII characters (beyond 255), so you have to get those symbols by using this specific font. Thus Pi and Delta are the same as P and D. When pasting the symbols from an external program like a text editor or character map, they just import as ? marks. If I was to replace an ampersand cluster, the replace string must still be formatted text. Maybe I am not fully understanding your solution. Oh, and my above post was not intended to show the actual ampersand cluster of pi and delta, they were supposed to be the actual symbols. Also how do I do a paste from within the Substitute function? Is it possible? If I could do a find a replace using clipboard data from a copied field that has the symbols (as formatted using the symbol font), then maybe it could work. However, my fear is that the Substitute function strips text of all its formatting, or maybe the entire Insert Calculated Result does. Then what to do? Thanks for your replies, BTW. I will try experimenting with Replace[].
March 20, 200322 yr As soon as you use a calculation your text will loose its formatting You can still pull it out with a script that loops thru the text, and pastes it back in blocks, recognizing where the symbol character should be placed and pasting in its place the proper symbol character that you've put in a global field
Create an account or sign in to comment