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

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

Recommended Posts

Posted

HELLO! Can you format selected text using a script?

For example I have a field called [note], I would like user to be able to type in the field and have the options to format selected text to...

- bold

- italic

- color change

- larger/smaller font size

I would have buttons by field for user to call on.

Any help or suggestions? THANKS!!!!

Posted

Fitch; Thanks for the link, good source!

Comment; Thank you for the code! I got it to work... almost. The script changes the ALL the text to red vrs only the SELECTED text.

I think the issue is in the

[insert Calculated Result (TextColor ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ) ; RGB ( 240 ; 0 ; 0 ) ) ]

Have I missed something?

Posted

Yep, unchecked... still no go. I'm sure it is something simple I have missed like this tho. Humm.

Posted

It works as a simple button, but I can not get it to work in the script.

I have attached a file to show problem, the script is a mess! Any help to clean up would be greatly appreciated. Thank you so much for your help.

text_formatter.fp7.zip

Posted (edited)

Deselect the Option to Select Field Contents in the script step Insert Calculated Result

Edited by Guest
Posted

Oops, I checked the field behavior, not the script option, sorry.

By the way, anyone know how I can TextFormatRemove in the script?

Posted

The problem with using TextFormatRemove() in this manner is that when you insert plain text into a field, it inherits the formatting of the text being overwritten (which sort of makes sense). This was discussed previously here:

http://fmforums.com/forum/showtopic.php?tid/173852/

This topic is 5202 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.