set a function to call up a certain code based on a user dropdown choice
I am building a tool that will apply a set of effects to the selected layer. The effects parameters will change based on a drop-down UI element chosen by the user. What is the best way to implement the function? Currently, I am using an if/else if to call different settings to be applied to each layer, but that isn't working.
I don't think that the if/else is the problem. You should call the selection by pixel_size.selection. However, when i have multiple choices, i usually use a switch statement. Easier to follow for me.
My Envato portfolio.
I will swap in the .selection
How would you put together a switch in this case?
I have added the .selection parameter, but the function doesn't execute.
Try: pixel_size.selection.text === "1px"