October 7, 200421 yr I just loaded the 7.0v3 update, and one change in behavior is causing me problems: Data pasted into a field now retains text formatting (color, font, size) from the source document. In my app, one piece of data is typically copied and pasted by users from a variety of sources. That piece of data is then re-used (via text calculations) in a variety of other fields. Until I ran the update, each of those other fields could have its own display characteristics (color, font, size) set in the layout. Now, the portion of the data that has been pasted carries the text characteristics from the source. Thus, in the middle of several fields, I've now got data that is in a variety of colors, fonts, and sizes. Is there a way I can strip those characteristics away, so that the attributes of the display field control instead?
October 8, 200421 yr er, maybe FM should make this an Option rather than setting it either way... before it wasn't, and due to request now it is. it was considered as a bug before, no?
October 8, 200421 yr What about under Default Field Behavoir if you select Synchronize with field's font? I have oftem wondered what that was for. Dave
October 8, 200421 yr Author Yeah, I checked out "Synchronize with field's font", but that's for something else: According to FM Help: "Automatically set the input method to one that is appropriate for the script type of the font used in the field. (If an appropriate input method is not available, the input method does not change.) ... Input methods are software utilities that convert keystrokes to characters in another language such as Japanese."
October 8, 200421 yr Sure easy to do. Just set the field to auto-enter a calculation to strip it and uncheck the replace box in options. Here is the calc: TextStyleRemove ( TextColor ( text_field ; RGB ( 0 ; 0 ; 0 ) ) ; AllStyles)
October 8, 200421 yr Uhm... as I had this 'problem' because I jump back and forth between Mac OS X and Windows, and the Mac version retains text formatting, I made use of a very simple script. The script cuts contents of the field, exits the field (commit in FM7), and then pastes the text back with no formatting. Like so (FM7 style) Cut[select; <Field reference>] Commit Records/Requests[] Paste[select; No Style; <Field reference>] Commit Records/Requests[] Nothing fancy, but works like a charm. Bankmann
October 12, 200421 yr Author Maybe I'm doing something wrong, mlemmnapa, but this: TextStyleRemove ( TextColor ( text_field ; RGB ( 0 ; 0 ; 0 ) ) ; AllStyles) doesn't seem to solve the problem. It doesn't change the font or font size, and it doesn't strip the color, it simply changes it to black. I'm looking for something that strips all the pasted text characteristics and lets the data take the characteristics set in the field display definition. [color:"blue"] [color:"black"]
October 12, 200421 yr Author Thanks, Bankmann, that seems to work -- cutting and pasting back. It stripped out the font, the color, and the size -- exactly what I was trying to do. Now it would be nice if FM just provided a text formatting function to strip this stuff (and I've therefore submitted it as an enhancement suggestion).
Create an account or sign in to comment