Your procedure to close multiple tabs lacks a
for each tab in list otherTabs block
(use it instead of that IF test), and you
need to make the current loop variable tab invisible
, not the list.
A list is illegal input to a block that expects a single component.