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.

Font: paste into FM ignore incoming font, replace with FM default

Featured Replies

  • Newbies

I tried to sum the problem up in the title, but to make it clearer.

We have helvetica as our default font, and regularly copy/paste text from other programs into FM. From the web/word/pdf etc. We would like the pasted text to adopt the default font but currently we are pasting the text with the font from the original text/document. Is there a setting or method for consistantly / easily adopting the default font upon pasting?

Many thanks,

Brendan.

Command Option V, key combination

uses the field formatting.

Cmd v uses the clipboard style, and ignors the fields formats and styles

Script step is Past w/o format

To read more on this, do a search of your Online FileMaker Help for Paste

HTH

Lee

Set up an auto-enter calculation on the text field with the calculation

TextFormatRemove( fieldname )

and set the calculation to replace existing contents.

  • Author
  • Newbies

Thanks guys,

Those tips helped. I got it. Unfortunately we already have a large database and many layouts, some have customised font/size as required. But most don't need it, it will be a big job running through all the layouts and scripting the fields.

In the mean time the paste cmd-opt-v is handy.

Many thanks, Brendan.

TextFormatRemove( self ) will work in FileMaker 9+ (though had problems with Data Separation files, fixed in 10)

This will not remove the Layout object formatting of fields. It will however remove the Browse mode "custom formatting" of text characters, i.e., someone selected some text manually in Browse mode and changed its formatting. These are two different things.

  • 10 months later...
  • Newbies

Fenton, that help'd a lot. The only thing is the pain to re-edit all the fields appearing in the UI. Thanks!

Let me ask you (and anybody else), do you use this solution for your projects or let the users edit the fields format? (or paste with format).

Yes, it is kind of a pain to redo existing fields, after you've implemented the TextFormatRemove(field). You can use ReplaceFieldContents, replacing the field with itself (via Calculation) after you've put your cursor in each field. This is tedious if several fields need it. But even worse, it is a very dangerous thing to do. If you are not careful, if you hit Replace when the default "current contents" is selected, you'll ruin that field, and there is no Undo. This makes me very nervous, especially if I'm forced to do it on live data.

A safer and easier method is to write the auto-enter calculation so that it can be triggered by another field, one that does not matter. This will work even when the field is a global. The following auto-enter calculation can be used on any field, just copy/paste. You would need a global field (number) in the table, for the z_gTrigger. Adjust the name to suit.

Let ( t = z_gTrigger; TextFormatRemove ( Self ) )

Then all you need to do is a Replace on the global "trigger" field. Since it is in all the calculations, all the fields with the auto-enter will be cleaned at once. After doing so, the global field does not need to be on the layout, nor have a value, as the regular auto-enter handles it after that.

*Requires FileMaker 9 for the Self function; if you have 8, you'll have to specify the field. If you have 7, you can use the Evaluate (Quote (field)) method (which is undocumented, but works.

Evaluate ( Quote (Test3); z_gTrigger ))

P.S. I've set up this file. You can try the button next to the global field once. But after that, you'd have to turn off the auto-enter for a field, as it will be cleaned automatically.

FormatRemove.fp7.zip

In regard to when I use this, I'd say I use it when necessary, and only when necessary. One reason to limit its use to only fields which need it is that it can slow down an Import, if the [x] Allow auto-enter option is on. But often that is not on, so it would make no difference.

I suppose you would not implement if the user wanted to use formatted text. But sometimes I've been told by the business owner, "I don't want all this junk in the fields, whether the users want it or not." :(-]

  • Newbies

Wow Fenton, it's a nice function! But it's a little out of my understanding. Just to clarify, the trigger function is a way to "call" the function when needed and not load FM with a script after each field commited. Right? Or is it a way to clean all the existing database with different formats and keep the script preventing new changes?

I'll have to learn a lot before being able to understand those formulas ... I'll learn post by post. Thanks!

The "trigger" global field, in the Let, is so you can clean multiple already populated (with junk) fields in an existing database via a single Replace into the global trigger field. That is what my example files shows (tho there ain't very many to see).

TextFormatRemove ( Self )

is all you really need to make cleaning work on new/edited entries. But it seemed you needed to clean existing data in several fields, hence the more complex (but not so much) method.

Always back up your file before trying this on real files.

  • Newbies

Ok, that's what I understood. It's a nice function.

Thanks a lot Fenton!

I have taken a slightly different approach on a system I made. I replaced the paste command using custom menus in filemaker advanced with a script that pastes without format. Then you just apply that menu set to any layout that you want that function on.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.