Why I get a non-empty selection via scripting when no rows are selected in the GUI?

@jessegrosjean, do you know how can I get zero from this script ?

(() => {
    const bike = Application("Bike"),
        doc = bike.documents.at(0),
        selectedRows = doc.rows.where({
            selected: true,
    return selectedRows.length


Now matter what I do in Bike’s GUI, I always get a number greater (or equal) to 1. Is it possible to have no selection of rows ?

(The cursor has to be somewhere, I think).

Generally not, but you could do it by:

  1. Press escape to enter outline mode
  2. Select all
  3. Delete

I don’t know if I should even allow that, but it’s possible now, and when you do it there are no rows, so the script will return 0.

Thanks you. Now that you explain, I think the current behaviour makes sense, in my initial tests.