Dropdown component Property change script triggered multiple times

I have a script component based upon a property change on a dropdown component.
I have a simple

print selected label
system.gui.messagebox("","")

for some reason the script runs twice whenever I select a different item on the dropdown list which would cause two message boxes to appear. Is there a way to prevent that script from running twice.

if event.propertyName=='selectedIndex':
   print selected.label
1 Like

Yeah, what Maynard said.
Seriously, if a property change script doesn’t have if event.propertyName..... ahead of each block of code, it’s wrong.

1 Like