FORUMS: list search recent posts

See if anything is selected in an listbox

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jacob Danell
See if anything is selected in an listbox
on May 26, 2014 at 7:17:01 pm

Hi! In my script I have a listbox, a button to add items and a button to remove items.
When the user presses the remove button I have a confirm-box asking if the user wants to remove, but I want this to only come up if anything is selected, else I want nothing to happen.
I have tried "my_palette.grp.lastRow.g02.RQ.selection.length != 0" but anything with .selection seems to make the script stop. After pressing the removebutton with nothing selected I can't add new items without restarting the script. My guess is becuase I'm trying to access .selection without it existing.

Does anyone know any other way to make sure that something is selected in the listbox?

Thanks!


Return to posts index


Dan Ebberts
Re: See if anything is selected in an listbox
on May 26, 2014 at 8:02:37 pm

I think it will be null if nothing is selected.

Dan



Return to posts index

Jacob Danell
Re: See if anything is selected in an listbox
on May 26, 2014 at 8:10:38 pm

It worked! I tried with underfined before and it didn't work. I thought that if nothing is selected, .selection can't exists and there for be undefined, but I was wrong. Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]