Need help with a targeting macro

I want to do something that starts attack if no target is selected, but doesnt do it if a target exists
/startattack keeps resetting swingtimer but I know a way to do it exists but I just can’t remember. anyone know of a macro command that does what start attack does, but is modifiable by commands?

/startattack shouldn’t reset your swing timer but you can slap a [noexists] on the end of it if you want.

/startattack [noexists]

no exists doesn’t work. my guy still gets stuck there scratching himself after stuff dies but mobs are beside the one I killed hitting the tank.
might be because noexist =/= noexists

Are you still targeting a corpse or a different target in that situation?

naw its like im targetting a new mob.
im thinking i get hit by a mob, and my dk just sits there until the rune comes off CD.

what would fix this… /startattack [noexists] [nodead]?
because what I think is happening is I get hit after my target dies but before I press any attack button when all my skills are on CD. and my guy just sits there. so it doesnt start attack because [noexists] is satisfied…

would I have to go /startattack [noexists]; [nodead] or something? I forget

No, anything that will /startattack on something that’s attacking you will do it on something you’re already attacking.