Newbies wishimac Posted July 29, 2004 Newbies Posted July 29, 2004 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.
CoZiMan Posted September 1, 2004 Posted September 1, 2004 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
Recommended Posts
This topic is 7392 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 accountSign in
Already have an account? Sign in here.
Sign In Now