Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7346 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

What about under Default Field Behavoir if you select Synchronize with field's font?

I have oftem wondered what that was for.

Dave

Posted

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."

Posted

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)

Posted

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)B)

Cut[select; <Field reference>]

Commit Records/Requests[]

Paste[select; No Style; <Field reference>]

Commit Records/Requests[]

Nothing fancy, but works like a charm.

Bankmann

Posted

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"]

Posted

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).

This topic is 7346 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.