July 29, 200421 yr Newbies Basically what I have is a Notes field, and some formatting buttons along the top. (Plain, Bold, Italic, Underline). I use one script for Bold, Italic, and Underline with the style as the script paramater. This is what it does... TextStyleAdd ( Middle ( text field ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ); Get ( ScriptParameter ) ) The problem is, If I've selected styled text (and only styled text) I can't get filemaker to remove the style from it. It does work, however, when I select the styled text and a single (or more) character(s) that is not styled. (Script paramater "AllStyles") TextStyleRemove ( Middle ( text field ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ); Get ( ScriptParameter ) ) I know I must be missing something. Help is appreciated.
September 1, 200421 yr Got this to work. Copy [ TestStyle::Text ] [ Select ] Set Field [ TestStyle::Text; TextStyleRemove ( "" ; AllStyles ) ] Paste [ TestStyle::Text ] [ Select; No style ] Experience editing the text for other reasons taught me that you have to COPY the text, DELETE the styled text, and then PASTE it with no style. Makes sense when you get the notion we aren't altering the interface menus (bold, italic, etc.) directly but actually through the programming interface and the 'selection' really doesn't exist in the field just the attributes as they are applied to what FMP thinks we are affecting. (There is a disconnect between ours and the programs notion of the selection and attribute.) Messy. I accomplish this in the interior of strings all the time for multiple options. Also for search strings or highlighted strings. You should see my 'parsing' and 'replacement' scripts
Create an account or sign in to comment