September 11, 200223 yr Hi gang, I've got a field called "stuff" which contains text that has been formatted (underlined, bold etc.). What I want is to set the field contents of another field, with formatting intact. Any idea on how to do this? I can't seem to find a way to do it, Cheers Steve Griff
September 11, 200223 yr The only thing I can think of is to use a 2-step script: Copy (from Stuff) and Paste (into destination field). This seems to work well in tests, but you may want to add script steps and fields that will store/restore the clipboard in the process.
September 11, 200223 yr I'm afraid I think you're right that copy and paste is the only way to move data around with its formatting intact. Which is unfortunate - not only because of the loss of clipboard contents, but also because of the need to ensure that the steps are performed on layouts where source and target fields are present and accessible. Maintaining the contents of the clipboard is also not a straightforward task unless you can be certain that the contents will be of a particular data type (and then script the choice of an appropriate global field to use as a temporary 'dump' location). Eg. if you try to place a container into a text field etc you won't get anything useful back. The only really elegant solution to this that I know of is the Troi ClipSave plug-in, which is a two-trick pony - it saves the clipboard and restores it.
September 11, 200223 yr Not to take anything away from Troi -- which makes a fine line of very useful plugins -- but Jazz has a freeware cross-platform plugin available which will also save/restore the clipboard. There is another thread somewhere on FMForums which details a good way to save/restore the clipboard, but the basic premise is something like: Save Clipboard Script Go to Layout ("Clipboard Layout") Paste (Global_Clipboard_Container) If (isEmpty(Global_Clipboard_Container)) Paste (Global_Clipboard_Text) End If and Restore Clipboard Script Go to Layout ("Clipboard Layout") If (not IsEmpty(Global_Clipboard_Text)) Cut (Global_Clipboard_Text) Else Cut (Global_Clipboard_Container) End If ... where Clipboard Layout is a layout containing two global fields: Global_Clipboard_Container (global container) and Global_Clipboard_Text (global text).
Create an account or sign in to comment