AE: Open all the files first, rather than inside a loop