Mouse-Clicked Scripting on Dropdown List

Hey folks,

I’ve seen mention of this in previous posts and I wanted to see if there is a recommended solution.

Mouse clicked scripting appears to work on the dropdown list as long as I do not click on the dropdown button on the right side.

My script is simple, just logging the selected value to a custom property before the operator chooses a new value. I just need to ensure that if the dropdown button is clicked that the same value is logged.

Script below, 7.9.1.
event.source.PreviousValue = event.source.selectedValue


If what you need to do is set the PreviousValue custom property to the value previously selected then I recommend putting the following script in the propertyChange event in the dropdown component. This works really well.

if event.propertyName == "selectedValue":
	event.source.PreviousValue = event.oldValue
1 Like

That worked like a charm, thank you!