Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can I eliminate text formatting from pasted data?

Featured Replies

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?

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?

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

I have oftem wondered what that was for.

Dave

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

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)

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

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

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

I've noticed the RGB 0,0,0 doesn't work BUT 1,1,1 does. Funny. Anybody else?

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.