How to access selected actor from common event while in menu

Thanks, Shaz! That simplifies my common event a lot!

Just for my own knowledge, how would it be different to access the target actor from the battle menu?
If you had it set to use Always rather than only from the menu, that's when you would use the formula. However, since you can also use it in the menu and you're doing that from a common event, you'll have to tweak it slightly:

if $game_party.in_battle ? b.equips[0].repair : 0; end

Original thread: https://forums.rpgmakerweb.com/threads/how-to-access-selected-actor-from-common-event-while-in-menu.38935/