As a first step towards constructing this, I have a field message handler in the main stack that triggers on selectionChange. For example, I might select a word in a field, planning to make it bold. This handler assigns values to two global variables, gCardID and gFieldID, identifying where this selection resides. After making a text selection, I then go to the substack, the text tool palette, and click a button. This button, "Bold", has the following handler:
Code: Select all
global gCardID,gFieldID--the field and card IDs of where selected chunk resides
on mouseUp
local tSelectedChunk,tStackName
put quote & the mainstack of this stack & quote into tStackName
put (the selectedChunk of field ID gFieldID of cd ID gCardID of stack value(tStackName)) into tSelectedChunk
do "set the textStyle[" & quote & "bold" & quote & "] of "& tSelectedChunk & " of cd ID " & gCardID & " of stack " & tStackName & " to true"
end mouseUp

Robert