Home Forums General XMetaL Discussion XFTReplacement for first instance of element Reply To: XFTReplacement for first instance of element

Derek Read

Reply to: XFTReplacement for first instance of element

I did not take into account the fact that a particular node might not have a previousSibling. You could wrap everything in a try…catch or code specifically for that case:

[code]var aipc = Application.ActiveInPlaceControl;
if(aipc.node.previousSibling) {
if(aipc.node.previousSibling.nodeName == aipc.node.nodeName) {
aipc.ShouldCreate = false;
};
else {
aipc.ShouldCreate = true;
};
}[/code]

Reply

Products
Downloads
Support