Change visibility of palette (Python)

Change visibility of palette (Python)
 1# this script changes the visibility of all palettes whose name begins with Cut/Crease
 2
 3# if any matching palettes are found, they are returned as an array (not a collection)
 4pals = impact.active_drawing.palettes.find_palettes( "^Cut/Crease" )
 5
 6# it is necessary to check that some palettes were found
 7if isinstance(pals):
 8
 9    # iterate through the array
10    for i in range(0, len(pals) - 1 + 1):
11
12        impact.gui.output_toolbox.add( pals(i).full_name )
13
14        # make palette invisible
15        pals(i).visible = ipBoolean.bFalse
16else:
17    impact.gui.output_toolbox.add( "no matching palettes found" )