Error script

When I run an .scr file and open more than 10 files, the following error "The depth of the maximum command stack exceeded "

how can I solve that

Thank you very much and greetings