Question re target macro

Hi. Thanks in advance for the help and apologies if this is a dumb question.

I have a macro that’s simple as dirt that I use when I’m waiting for a mob to spawn or the like.

/tar mobimwaitingfor
/cast Judgment

I bind this to a key and mindlessly spam q or whatever until the mob shows up and I tag it.

I would love to have a way to set the name of the mob without having to open up the macro, delete oldmobname and type in newmobname. For example, if the corpse of the mob was there when I showed up, if I could target it, or make it my focus, or something and hit another key that would set the target name in the targeting macro to the name of the mob, that would be awesome.

I don’t think this is doable with macros, and I’m not aware of an addon that would do it, but I thought it was worth posting the question here in case someone had an idea that might work.


do you mean /targetlasttarget

I’m not understanding exactly what you want to do

Make one macro named target (or anything unique–the other macro will edit this)

/target anything

Make another macro named target-set (this you can rename whatever; it will edit the macro named target):

/run if not InCombatLockdown() then EditMacro("target",nil,nil,"/target "..(UnitName("target") or UNKNOWN)) else print ("Can't set target while in combat") end

Out if combat, hitting the target-set macro will change the target macro to /target whatever you currently have targeted.

(These can be combined into one macro with an alt modifier, but in my experience a macro editing itself will often cause weird behavior like sending the last line to your last chat channel; and target something with a really long name will wipe out the end of the macro.)

1 Like