_command ot, open_table(tableName) name_info(','VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
VSARG2_REQUIRES_EDITORCTL --> "This command is not allowed unless there is an open active not minimized buffer window".
Look up help on the VSARG2_* stuff (look up "name_info" in the Help) for a table that describes the flags to help you pick which ones are appropriate for your situation.
For example, the "edit" command that your macro calls has these flags:
name_info(FILE_MAYBE_LIST_BINARIES_ARG'*,'VSARG2_CMDLINE|VSARG2_REQUIRES_MDI|VSARG2_NOEXIT_SCROLL)