Thanks, that works. Is there a reason that the next document command is not recorded?
Yes. Not all the commands are recorded. In this case, the macro will be interrupted if the Next Document command is executed when the Tab Bar is not enabled. I might consider adding more commands that can be recorded in the future.