ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Scripting - DropdownList Selection/Enabling issue

COW Forums : Adobe After Effects

Respond to this post   •   Return to posts index   •   Read entire thread

Will Poillion
Re: Scripting - DropdownList Selection/Enabling issue
on Mar 27, 2019 at 8:20:33 pm

Thank you Mike!

I knew my code wouldn't be easily testable and I apologize for that. I was hoping someone would just provide their own experience and give me a hint to figure it out and you did.

When you said you never de-select I thought that might be doing it and it was at least partly.

Setting this doesn't work as you might expect:
midi_smith.noteLengthDD.selection = null;

It did de-select but I think it messed up the internal object structure of the dropdown. So I removed this and only changed the selection never nulled it out.

Which just means I had to add some extra error checking. What I also found was disabling options that were already disabled seemed to mess it up as well. I thought if I got the current selection index, I could enable/disable all the options (including enabling ones that were already enabled, etc) and then loop through all the options and if the currently selected index was now disabled, select the closest enabled option. Which meant re-selecting the same option if it wasn't disabled.

This just seemed to mess stuff up. When I added the error checking to only disable/enable options that weren't already in that state, and only change the selection if current selection was disabled, it's working fine now.

But just the hint of not de-selecting only changing the selection gave me the hint I needed 😉


Posts IndexRead Thread 

Current Message Thread:

© 2019 All Rights Reserved