Scripts get the same information Lich uses to parse container contents, so capturing that XML is a more reliable indication that a container inventory has been provided.
Of course, that information will not be sent if the target in question is not actually a container, so the existing trap for "There is nothing in there" should remain as well.