Jump to content
Server Maintenance This Week. ×

Changing text attribute of selection - revisited


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

Recommended Posts

I have a button script that changes the size of a selection in a text field. 

This is it:

Insert Calculated Result [ TextSize ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get
( ActiveSelectionSize ) ) ; $size ) ] 

A problem with this is that if the selection begins with styled characters (bold, underlined, etc) then the entire resized area becomes styled. If there is at least 1 unstyled character before the first styled one, then all styled and unstyled characters remain as they were. What is missing from the calculation? 

Link to comment
Share on other sites

I have tested this on my own and I am not sure if this is a bug or an intended behavior. The Insert Calculated Result[] script step behaves in this aspect the same as the Replace() function. The inserted text takes on the style of the text at insertion point (in addition to any style/s it may have on its own). Perhaps they (FMI) thought that would be helpful.

Link to comment
Share on other sites

  • 3 weeks later...

I'm not sure what the reason would be for intending this behavior. It is clearly an annoying behavior. The only workaround is to insert an unstyled character in front of the selection, make the change then remove the extra character. 

Link to comment
Share on other sites

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