August 26, 201015 yr 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!!!!
August 27, 201015 yr Yes, check this out: Style buttons - Custom and extended formatting functionality on demand
August 27, 201015 yr See also: http://fmforums.com/forum/showtopic.php?tid/198604/post/305425/#305425
August 27, 201015 yr Author 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?
August 27, 201015 yr Author Yep, unchecked... still no go. I'm sure it is something simple I have missed like this tho. Humm.
August 27, 201015 yr Author 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
August 27, 201015 yr Deselect the Option to Select Field Contents in the script step Insert Calculated Result Edited August 27, 201015 yr by Guest
August 27, 201015 yr Make sure the option "Select entire contents" is unchecked. Yep, unchecked... Check again.
August 27, 201015 yr Author Oops, I checked the field behavior, not the script option, sorry. By the way, anyone know how I can TextFormatRemove in the script?
August 28, 201015 yr 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/
Create an account or sign in to comment