Home › Forums › General XMetaL Discussion › XFTReplacement for first instance of element › Reply To: XFTReplacement for first instance of element
Reply to: XFTReplacement for first instance of element
January 29, 2014 at 11:02 pmI 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]