Jeff Hooker wrote: > > Just FYI, here's what I did, and it works. It's clumsy,
I don't think so. I don't see what else you could have done aside writing your command in Java. > but I need to move on to other jobs: > > <commandname="insertStateNames2"> > <macroundoable="true"repeatable="true"> > <sequence> > <commandname="insertNode"parameter="sameElementAfter[implicitElement]"/> > <commandname="putAttribute"parameter="name '%0'"/> > <setvariable="selectedElement"context="$selected"expression="following::pmc:signal"/> > <setvariable="selectedElement"context="$selected"expression="pmc:state[last()]"/> > <commandname="insertStateNames2"parameter="'%0'"/> > </sequence> > </macro> > </command> > > > <commandname="insertStateNames"> > <macroundoable="true"repeatable="true"> > <sequence> > <commandname="xpathSearch"parameter="//ns:signal/ns:state[last()]"/> > <getexpression="join(//pmc:testComponent/pmc:states/pmc:state/@name, ' ')"/> > <commandname="pick"parameter="'Choose state:' false %_"/> > <commandname="insertStateNames2"parameter="'%_'"/> > </sequence> > </macro> > </command> > This allows the user to select a state name, then adds a new field for the > state state to every "signal" element. Since there are often hundreds of > signals, automating this was important. > Your macro looks fine. I would recommend removing undoable="true" repeatable="true" from insertStateNames2 because it's insertStateNames which is undoable and repeatable and not insertStateNames2 (which is never directly invoked by the user).

