Jump to content
Server Maintenance This Week. ×

FMP 17 create a button to format text in a text field. 


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

Recommended Posts

Is this at all possible?

 

I want to have two buttons that will each do the following. 

Have one button to ‘Strike Thru’ text that is highlighted before.  Means not all the text in the field will be changed.

And one button to change the text colour to Red, again highlighted before.  Means not all the text in the field will be changed.

 

Any tips how to do this?  Please bare in mind I am a FMP beginner.  Thanks. 

Link to comment
Share on other sites

7 hours ago, ChangeAgent said:

Have one button to ‘Strike Thru’ text that is highlighted before. 

Assuming "highlighted" mean selected, make your button insert a calculated result =

TextStyleAdd ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ) ; Strikethrough )
7 hours ago, ChangeAgent said:

one button to change the text colour to Red,

Same thing - just use the TextColor() function instead.

Do note that this may exhibit some quirky behavior when the text already has some styling at the insertion point.

 

7 hours ago, ChangeAgent said:

Please bare in mind

I prefer to remain clothed.

 

Edited by comment
Link to comment
Share on other sites

  • 2 months later...

Perhaps add a "TextFormatRemove" (using comment's calculation as a script step) just before the TextStyleAdd step would clear up any quirky behavior.  Of course, you'd have to be careful because that would remove ALL previous formatting from the text.

Link to comment
Share on other sites

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