Working with Items

Categories:Common workflows

Deleting unused folders in the library

The following example recursively removes all empty folders from the library:

do{ collection = $$(':folder:empty').deleteItems() } while( collection.elements.length );

Organise your library by item type

The following example organises your library items into subfolders per item type under the root folder assets/, then deletes empty folders:

// move assets depending on type
    $$(':folder').expand();
    for each(var type in ['movieclip', 'bitmap', 'graphic', 'button', 'sound'])
    {
        $$(':' + type).move('assets/' + type, false, true);
    }

// delete empty folders
    do{collection = $$(':folder:empty').deleteItems();}
    while(collection.elements.length > 0);

Comments are closed.