Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions See if anything is selected in an listbox

  • See if anything is selected in an listbox

    Posted by Jacob Danell on May 26, 2014 at 7:17 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!

    Jacob Danell replied 11 years, 12 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 26, 2014 at 8:02 pm

    I think it will be null if nothing is selected.

    Dan

  • Jacob Danell

    May 26, 2014 at 8:10 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!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy