docsforadobe / aequery

MIT License
41 stars 8 forks source link

Add 'aeq.project.getSelectedCompsOrAll()' method? #36

Closed runegan closed 6 years ago

runegan commented 7 years ago

Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).


    /**
     * Gets selected comps, or all comps if none is selected.
     *
     * @method
     * @memberof aeq
     * @return {aeq.arrayEx}  ArrayEx of Comp objects
     */
    function getSelectedCompsOrAll () {
        var comps = aeq.project.getSelectedComps();

        if (comps.length == 1)
            comps = aeq.arrayEx(comps);

        if (aeq.isEmpty(comps))
            return aeq.getCompositions();

        return comps;
    }
runegan commented 6 years ago

Original comment by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).


Adds aeq.project.getSelectedCompsOrAll (resolve #36)