aeq.forEach does not work with ScriptUI container children array

Issue #28 new
Rune Gangsø
created an issue


var win = aeq.ui.createWindow()
aeq.forEach( win.get().children, function( key, value ) {
    alert( key + value )

This only alerts ones, with the text length3.

Caused by bad checking of array type in aeq.forEach

Comments (4)

  1. Zack Lovatt

    One workflow solution--

    aeq.arrayEx(win.get().children).forEach( function( child ) {
        alert( child.text )

    or to solve the specific issue, we can change aeq.forEach array detection from... if ( obj && obj ) === '[object Array]' )


    if ( obj && ( obj ) === '[object Array]' || === 'Collection' ) )

    Thoughts @Rune Gangsø ?

  2. Zack Lovatt

    Everything I've seen does, but not sure about everything. Issue is that with some array-ish elements return [object Array] and others include a string of the elements within them (maybe only ESTK's Collections). My suggestion above seemed robust, but better to double-check.

  3. Log in to comment